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:

What’s HHVM?

HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP. HHVM uses a just-in-time (JIT) compilation approach to achieve superior performance while maintaining the flexibility that PHP developers are accustomed to. To date, HHVM (and its predecessor HPHPc before it) has realized over a 9x increase in web request throughput and over a 5x reduction in memory consumption for Facebook compared with the PHP 5.2 engine + APC.

This tutorial provides a sample spring MVC application that allows user sending an e-mail message.

In this tutorial, you are supposed to familiar with Java EE development as well as developing Spring MVC-based applications.

Spring Framework’s Support for E-mail

Based on JavaMail, Spring framework provides high-level abstraction API which greatly simplifies e-mail sending process. Let’s take a brief look at this API in the following class diagram:

To send e-mail messages, we can use an implementation of interface MailSender – the JavaMailSenderImpl class which is built upon on JavaMail. It’s convenient to configure this implementation as a bean in Spring’s context:

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.

Clover is a new and exciting open source EFI bootloader. Developed over the past 3 years by a group of developers at Project OS X led by Slice, Clover aims to solve problems inherent in existing OS X installation methods and legacy bootloaders:

  • Boots troublesome desktop and laptop BIOS/UEFI
  • Uses native OS X installation media
  • Ability to patch DSDT/kernel/kexts at boot time
  • Creates OS X Recovery partition
  • No boot0 error with 4K Advanced Format drives
  • Solves multi-boot issues with Linux and Windows 7/8
  • Solves traditional bootloader NVRAM issues related to iMessage/FaceTime

Clover has a completely different system of configuration with a decidedly steep learning curve. It can be confusing for those who have only ever used the more traditional Chameleon or Chimera.

Almost all collections in Java are derived from the java.util.Collection interface. Collection defines the basic parts of all collections. The interface states the add() and remove() methods for adding to and removing from a collection respectively. Also required is the toArray() method, which converts the collection into a simple array of all the elements in the collection. Finally, the contains() method checks if a specified element is in the collection. The Collection interface is a subinterface of java.lang.Iterable, so any Collection may be the target of a for-each statement. (The Iterable interface provides the iterator() method used by for-each statements.) All collections have an iterator that goes through all of the elements in the collection. Additionally, Collection is a generic. Any collection can be written to store any class. For example, Collection can hold strings, and the elements from the collection can be used as strings without any casting required.

Spring Framework is developed on two core concepts – Dependency Injection and Aspect-Oriented Programming (AOP). Today we will look into the core concepts of Aspect-Oriented Programming and how we can implement it using Spring Framework.

Aspect-Oriented Programming Overview

Most of the enterprise applications have some common crosscutting concerns that is applicable for different types of Objects and modules. Some of the common crosscutting concerns are logging, transaction management, data validation, etc. In Object-Oriented Programming, modularity of application is achieved by Classes whereas in Aspect-Oriented Programming application modularity is achieved by Aspects and they are configured to cut across different classes.