Creating Framework-Agnostic PHP Packages

One of the common problems with PHP used to be that if you chose to use a particular framework, you were only able to use the libraries and plugins that are made specifically for that PHP framework. It was difficult to switch the frameworks or to re-use the code between frameworks. However, PHP has experienced major changes recently. Composer, a package manager widely used by PHP developers, and latest generation frameworks, such as Laravel and Symfony, have enabled PHP developers to create framework-agnostic packages.

Posted by on 20 August 2015 | 4:35 pm

PHP Explode Tips and Tricks

The PHP Explode and Implode functions are both powerful tools to have in your back pocket when developing applications. They can save you a lot of time, lines of code, and unnecessary looping if used correctly.

Posted by on 30 July 2015 | 3:17 pm

Implementing Two-Factor Authentication in PHP

Two-factor authentication is a type of authentication that "provides unambiguous identification of users by means of the combination of two different components." These authentication components could be something that the user knows, something that the user possesses or something that is inseparable from the user. In this tutorial, you will learn how to implement two-factor authentication in PHP.

Posted by on 15 July 2015 | 3:28 am

Connecting PHP Apps to Google Cloud Storage

In this article, Gigi Sayfan shows you how to take advantage of Google's Platform as a Service (PaaS) in order to create a scalable, highly available and secure PHP web application.

Posted by on 30 June 2015 | 4:06 am

How to Create a Secure Websocket Connection

WebSocket is a relatively new technology that enables a persistent connection between client and server over TCP protocol. In other words, it allows bi-directional socket connections to a server, where both server and client can send the data at any time. This article will focus on WebSocket's security issues and possible solutions to its vulnerabilities.

Posted by on 17 June 2015 | 2:58 pm

Migrating Legacy Applications to AngularJS

John Barlow admit its, he was a little afraid of AngularJS at first. He had seen other frameworks that were similar and immediately discounted this as "just another JavaScript framework" — until he used it. In those short moments he discovered that AngularJS is magical, and decided he must use it for all new projects and migrate the old projects.

Posted by on 14 May 2015 | 1:33 pm

Dependency Injection with the Silex Micro-Framework

Silex comes packed with its very own built-in dependency injection container called Pimple (this is also a standalone dependency injection container) which is a very lightweight, yet powerful, container. Let's delve into how it works.

Posted by on 30 April 2015 | 12:31 pm

Overview of the Silex Micro-Framework

Usually a micro-framework leaves pretty much everything up to you. You can do with it as you please and mostly you can get away with anything. Unlike a regular, full-stack framework, a micro-framework will not dictate much in terms of where to put things or how to do things.

Posted by on 10 April 2015 | 2:02 pm

Counting Facebook Likes and Twitter Tweets in Your App

Learn how to fetch the data from Facebook and Twitter, how to optimize the connection to these web sites and how to automatically update the data.

Posted by on 26 March 2015 | 2:59 pm

Working with the PayPal API

PayPal recently introduced a new RESTful API that is more convenient and more powerful than the previous version. Learn how to integrate your PHP application with the new PayPal API.

Posted by on 9 March 2015 | 11:55 am

More PHPUnit Helpers

In my previous article, I expanded a few ideas around test helpers and how to use setUp() and tearDown(). However, we still stayed in the realm of things built in to PHPUnit. Here, I want to expand on a helper function I include in most of my main testing classes that allows for the concept of setUp(), but grants a bit more flexibility.

Posted by on 23 February 2015 | 3:32 pm

Working with PHPUnit Test Helpers

introduction to PHPUnit and how to do object mocking. While necessary, sometimes all of the setup work can become tedious for large projects. In this article, I hope to show how some helper methods can make test writing much easier and faster.

Posted by on 30 January 2015 | 12:00 pm

Getting Started With Laravel Homestead

Laravel follows a slightly different approach to PHP development. Using ideas usually found in the .NET environment, such as Facades, and sporting an Inversion of Control Container, Laravel claims to be the future of PHP. Whether or not this is the case is too early to tell, but it certainly is popular.

Posted by on 15 January 2015 | 12:16 pm

Advanced Mocking with PHPUnit

One way of constructing the mock object is to replace functions with stubs that just return NULL. This is useful for utility functions that call an external resource such as an API or database. This is useful for when you don't care what comes back, but the code you are testing calls a function that needs to be accounted for.

Posted by on 17 December 2014 | 6:51 am

Using Global Variables in PHP

Leverage the power of global variables in PHP to make variables globally available and share data across functions and programs.

Posted by on 3 December 2014 | 9:59 am

Test Driven Design with PHPUnit

Test Driven Design is the process of writing unit tests first (expecting them to fail) and then writing the code to make the tests pass. The benefits of doing this include: • forces the programmer to plan out the functionality head of time • forces the functions to be small, concise, and testable • leaves the programmer with a full unit test suite with 100% test coverage

Posted by on 19 November 2014 | 10:00 am

Best Practices for Refactoring in PHP

A developer may consider his code as perfect if it runs successfully without any compile-time or run-time error. But there is always a scope of improvement in working code and refactoring improves the structure of existing code. The code, if not improved, may hamper the performance of an application considering factors such as memory, speed, reusability, etc.

Posted by on 30 October 2014 | 8:31 am

Closures in PHP Who Knew?

Closures (also known as anonymous functions or lambda functions) are just that - Anonymous or closed. They don't follow the standard function declaration, and can be created inline. If you've used any modern JavaScript library, you've already done this.

Posted by on 15 October 2014 | 11:40 am

Most Important Features in PHP 5

PHP 5 introduced a set of new features and functionalities to improve performance, efficiency and more. There are three major areas in which the improvement is significant. This article will discuss the most important features introduced in PHP 5.

Posted by on 24 September 2014 | 5:01 pm