PHPStorm - Top Productivity Hacks and Shortcuts
This article shares some keyboard shortcuts and tips which you should make part of your regular routine if you work in the IDE PHPStorm.
Mockery 0.9.0 Has Landed…Mostly In One Piece!
Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit’s phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the world ending.
Implement Flash Messages using Session in PHP - Part1
A Flash Message is a message that will be shown/displayed only once. If you reload the browser, or navigate to another page and come back again, the message will no longer be displayed. This article shows how to implement Flash Messages using PHP Session.
CAPTCHA Image Using GD Library
Although not usually a fan of CAPTCHA images, Martin Psinas found himself in need of one when he realised alternative methods are not always foolproof.
How To Make Custom PHP Changes Using A .user.ini File
At times, you will want to use software that requires a custom php.ini file or custom PHP configuration changes, such as increasing the memory limit or upload limit that your site is allowed. Since these are settings that we can not change on a server-wide basis, you would need to make these changes locally on your account. Fortunately, with these easy to follow steps, you can have a .user.ini file created and customised within minutes!
Managing Gettext Translations on Shared Hosting
If you’re working for a big company, chances there are that sooner or later your employers will start to target the global market. With this ambition will come the need to translate the company’s website into one or more languages. Even if you don’t work for a big company, you may have a new service to launch in your native language (assuming you’re not a native English speaker) to target your local market, and in English for the global one. As developers, our role isn’t to translate texts but to prepare the website to support translations. The most popular method to do that in PHP is via Gettext.
Verify Email Address Using PHP
Sometimes you may need to verify a user’s email address. This article explains how to do this with PHP.
What Application Layer Does A DI Container Belong In?
Paul M.Jones received this question via Twitter this week. Read his response here.
HHVM and Hack – Can We Expect Them to Replace PHP?
This article will focus on HACK, which is an evolution of the PHP language designed to be safer, to enable better performance and to improve developer efficiency. Note that both HACK and PHP are equally supported by the HHVM. Despite the fact that HACK is in use at Facebook on all the production servers, only little info has been leaked for now. In a nutshell, HACK is Facebook's PHP6 – it proposes to fix most of what's wrong with PHP today, while adding some new features like static typing along the way. You can install a Vagrant virtual machine to start experimenting with HACK and run the code snippets from this article.
Constructing Hard Regular Expressions with VerbalExpressions
Most newbie (and some seasoned) programmers have difficultly constructing Regular Expressions. There may be a time when one needs to create a Regexp quickly to test a a particular piece of code. However, not being comfortable with Regexps can be a problem. VerbalExpressions is a PHP library that enables you to construct regular expressions using natural language like constructs. Think of it like a DSL for building Regexps. This article features a sample PHP code that constructs a regular expression which tests whether a given string is a valid url.