Tutorials and Talks
Smart Guide On Creating a Complete PHP Package Using Composer
Composer is also used to create custom packages from open source packages and/or private packages. These custom packages could then be installed using the above mentioned command. In this article, I will demonstrate the package creation capability of Composer by creating a package for Twitter search API. I will then register it and install it on my server.
Building Your Startup: The Dashboard Foundation
This tutorial is part of the Building Your Startup With PHP series on Envato Tuts+. In this series, I'm guiding you through launching a startup from concept to reality using my Meeting Planner app as a real-life example. In today's episode, we'll build the foundation for our administrative dashboard and take on and create some of the initial live and historical reporting.
Containerising a Static Website With Docker, Part II
In the previous post we looked at the process of designing a build container, consisting of all the required build tools for generating a static website from source files. In order to see the result of the build process, we still need to design another container, which runs a simple web server, serving the static website (mainly .html, .css, .js and .jpg files).
Dynamic Git Branch Subdomains With Laravel Envoyer and Apache
Let’s say you have a staging environment that usually has the latest commit of the master branch deployed. Sometimes though you might want to stage multiple branches at the same time.
Fire Up BDD Inside Docker With Cucumber and BDDfire
BDDfire allows you to set up the entire framework with code quality, browser testing, cloud testing, API testing and Docker integration, by running three simple commands.
Home-Made Twitter and Gmail Notifications with PHP and Arduino
I am a little obsessed with Twitter. It’s how I communicate with most of the developers I’m not fortunate to live in the same city as. I’m a little less obsessed with IoT projects, but then it’s harder to find the time to work on them than it is to check Twitter. Unless I can do both at the same time. Ever since the IoT week, I’ve been meaning to work on a project that will let me know when someone wants to speak to me. Something that looks cool, and is at the same time non-invasive. This is what I’ve come up with…
How to Build a Multilingual App: A Demo With PHP and Gettext
Whether you are building a website or a full-fledged web application, making it accessible to a wider audience often requires it to be available in different languages and locales. Fundamental differences between most human languages make this anything but easy. The differences in grammar rules, language nuances, date formats and more, combine to make localisation a unique and formidable challenge.
Implement JSON-RPC with zend-json-server
zend-json-server provides a JSON-RPC implementation. JSON-RPC is similar to XML-RPC or SOAP in that it implements a Remote Procedure Call server at a single URI using a predictable calling semantic. Like each of these other protocols, it provides the ability to introspect the server in order to determine what calls are available, what arguments each call expects, and the expected return value(s); JSON-RPC implements this via a Service Mapping Description (SMD), which is usually available via an HTTP GET request to the server.
Voyager – Can an Admin UI Make Laravel Even More Approachable?
Today, we are talking about Voyager! Voyager is a Laravel package that provides a full administration system for the framework in its “skeleton app” form. Let’s take a closer look at it.
All Hail Xdebug And Lets Let Var Dump Die
How many times have you been working in Magento or any other PHP application and hit an error, exception or something not quite right? For me it's a lot. I’ve been that developer that debugs by fire and throws echo var_dumps and dies around like a western gunslinger. It’s easy and provides quick feedback cycles but, lets be honest, it's lazy, inefficient, rarely provides all of the data you need to solve the problem on the first try and it's not something you want to boast about by the coffee machine. Before we look at the future let's take a trip into the past and well present for some people. What can go wrong and what are we missing by adding these “debug” statements to our code?
Programming With Yii2: Helpers
In the Programming With Yii2 series, I'm guiding readers in use of the Yii2 Framework for PHP. In this tutorial, I'll provide a brief overview of helpers. In Yii, helpers are modules which group commonly useful libraries for string, file, image, URL and HTML management amongst other things, and they are easy to extend.
Getting Rid of Static
When people start (unit-)testing their code one of the worst problems to tackle is static calls. How can we refactor static calls out of an existing application without breaking the code and while producing new features? How can we get rid of this big test impediment?
Homestead Per-Project Crib Sheet
I wanted a drop-dead simple way to try and replicate a problem someone was having on the Slim forums. I couldn't reproduce with php -S which is my go-to for this sort of thing, so I thought I'd try Homestead. I had recently listened to a Voices of the ElePHPant episode with Taylor Otwell & Joe Ferguson where Joe mentioned that Homestead worked on a per-project basis too. I didn't know this, so tried it out. The docs are fine, but there's a lot there that covers the global installation option when I just want to get up and running on a per-project basis.This is my crib sheet.
Crate: Eventual Consistency
Some projects at work use a Crate database as a kind of caching layer for aggregated, unnormalised data that helps reducing requests from front-end servers. Because of its eventual consistency model, filling data into it has some issues.
Simple Tutorial On Using MySQL With PDO That Works With PHP 7
Most PHP applications use MySQL databases, but since PHP 7 was introduced the old MySQL extension was discontinued. Developers need to migrate either to using MySQLi or PDO. Using PDO makes your code usable also with other types of databases besides MySQL. Read this tutorial to learn how to perform simple common database queries, as well perform table schema management operations, using the PHP PDO database class.
Optimising Your PHPUnit Workflow in Sublime Text
Convincing yourself to skip writing tests is easy when your testing workflow is slow and painful. Here's some tools and tricks I use to make sure testing doesn't slow me down.
PHP Likes Sorting Too Much
PHP likes to sort. Of course, there is sort(), ksort() and all the cousins. But, PHP actually sorts too much. My first encounter with the problem is the infamous array_unique(). Now, this is also affecting glob() and scandir(). I’m looking for others. Until then, check your code.