PHP

A solid unit test suite is essential for ongoing development in large projects, especially those with many people involved. Going back and manually testing every individual component of an application after every change is impractical. Your unit tests will help alleviate that by automatically testing your application’s components and alerting you when something is not working the same way it was when you wrote your tests. The Zend Framework 2 API uses PHPUnit, and so does this tutorial application. A detailed explanation of unit testing is beyond the scope of this tutorial, so we will only provide sample tests for the components in the pages that follow. This tutorial assumes that you already have PHPUnit installed.
In this article, you will learn how to create a custom view helper in Zend Framework 2. A concrete example will be used; a helper which generates links for a subdomain, intended for storing static files. This is especially useful if you wish to use a Content Delivery Network (CDN). With very little modification, the helper can be made generic to support links to subdomains for all purposes. The Helper Class Let us begin by creating the helper class. It can be added within any module, but a suitable place would be within the Application module, provided that you made use of the Skeleton Application. Create a file CdnHelper.php in zf2-tutorial\module\Application with the following subdirectories:

TestZilla

Introduction TestZilla is a crowd testing platform that is built on the Phalcon framework. Our goal is to create a global crowd testing system for all platforms. Initially, the application was built using the Spring MVC framework, but we have since rebuilt it using the Phalcon framework for continuous delivery. Code Repository GitLab Screenshots
Introduction Nginx is one of the most popular web servers in the world and is responsible for hosting some of the largest and highest-traffic sites on the internet. Tengine is a branch of Nginx which is created by Alibaba Inc. MariaDB is a database server developed by some of the original authors of MySQL and offers drop-in replacement functionality. Prerequisites Before you begin this guide, you should have a regular, non-root user with sudo privileges configured on your server.
One of the most common questions I get asked by PHP beginners is, Why are there 4 ways to include a file on your page? There is include(), include_once(), require() and require_once(). What do these do? What’s the difference between them? In this article, we’re going to look at all these different functions and will talk about an example of when you need to use each of them. include() The include function is used in PHP when you want to include a file within the current process. It takes one argument which will be a string to the file path you want to include.
Yesterday, I spent several hours solving this problem. In Laravel Framework, you can do as following: Mail::send("mails.reset", $data, function ($message) use ($email) { $message ->from("noreply@infinitescript.com", "CourseOcean") ->subject("Reset Your Password"); $message->to($email); }); Step 1: Create an Email Template First of all, you need to create an email template in the views folder, such as /view/mails/reset.phtml. <table cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td style=" padding: 15px 15px 0 15px; background: #fff; border-radius: 4px 4px 0 0; " > <div> <img src="http://lab.haozhexie.com/CourseOcean/img/logo.png" alt="CourseOcean" height="85" width="290" /> </div> </td> </tr> <tr> <td style=" padding: 15px; background: #fff; border-radius: 0 0 4px 4px; font-size: 12px; " > We received a request to reset the password for your account, <?=$this->username?>.<br /><br /> If you made this request, click the link below. If you didn't make this request, you can ignore this email.<br /><br /> <a href="http://lab.haozhexie.com/CourseOcean/accounts/resetPassword?email=<?=$this->email?>&amp;keycode=<?=$this->keycode?>" target="_blank" style="color: #005399; text-decoration: none" >http://lab.haozhexie.com/CourseOcean/accounts/resetPassword?email=<?=$this->email?>&amp;keycode=<?=$this->keycode?></a ><br /><br /> Yours, <br /> CourseOcean.<br /><br /> <div style=" border-top: 3px solid #eee; color: #999; font-size: 11px; line-height: 1.2; " > <br />Powered by <a href="http://lab.haozhexie.com/CourseOcean/" target="_blank" style="color: #005399; text-decoration: none" >CourseOcean</a >. All rights reserved.<br /> </div> </td> </tr> </tbody> </table> Step 2: Complete Sending Email Function function sendResetPasswordEmail($username, $email) { $keycode = $this->generateRandomString(32); $view = new \Zend\View\Renderer\PhpRenderer(); $resolver = new \Zend\View\Resolver\TemplateMapResolver(); $resolver->setMap([ "mailTemplate" => __DIR__ . "/../../../view/mails/reset.phtml", ]); $view->setResolver($resolver); $viewModel = new ViewModel(); $viewModel->setTemplate("mailTemplate")->setVariables([ "username" => $username, "email" => $email, "keycode" => $keycode, ]); $bodyPart = new \Zend\Mime\Message(); $bodyMessage = new \Zend\Mime\Part($view->render($viewModel)); $bodyMessage->type = "text/html"; $bodyPart->setParts([$bodyMessage]); $message = new \Zend\Mail\Message(); $message ->addFrom("noreply@infinitescript.com", "CourseOcean") ->addTo($email) ->setSubject("Reset Your Password") ->setBody($bodyPart) ->setEncoding("UTF-8"); $transport = new \Zend\Mail\Transport\Sendmail(); $transport->send($message); }

Course Ocean

Introduction CourseOcean is aimed at serving as a training platform for IT skills, where anyone can create a course and anyone can find a suitable course for themselves. Code Repository GitLab Screenshots
Many times while using WordPress, if we try to use “$” to access jQuery, we get an error the “$ is not defined”. This happens because the jQuery library which is included in WordPress loads in “no conflict” mode. In the no conflict mode jQuery returns the control of “$”, and it is no longer accessible as a function, variable, or alias for jQuery. WordPress does this in order to prevent compatibility problems with other JavaScript libraries that can be loaded.