Tutorials and Talks
Decouple Controller from Symfony using Traits
If you start using controllers as services, you still often need helpers methods of Controller from FrameworkBundle. So your code still depends on service locator and decoupling is not really happening. Today I will show you how to remove the dependency on Controller and keep those fancy methods at the same time.
The Art of Defensive Programming
Why don’t developers write secure code ? We’re not talking yet another time about “clean code” here. We’re talking about something more, on a pure practical perspective, software's safety and security. Yes, because an insecure software is pretty much useless. Let’s see what insecure software means.
Programming With Yii2: Using Amazon S3
In this Programming With Yii2 series, I'm guiding readers in the use of the Yii2 Framework for PHP. In today's tutorial, I'll walk you through the basics of browsing, uploading and downloading files to and from Amazon's cloud-based S3 storage service. Essentially, I've created a simple storage model and controller as examples which you can extend for your needs.
Using the Silverstripe TemplateParser For Something Else…
We are currently experimenting with Bookdown to generate the documentation for our open-source components in one central location. Obviously the generated site should have a similar look`n`feel as this blog, or our website. Since both instances are powered by Silverstripe and share a theme I was curious if it is possible to use this theme within Bookdown. As it turns out, it is not that difficult 😉
Creating a Custom WordPress Messaging System, Part 3
At this point in this series, we've laid the foundation for our plugin, defined a custom hook, and wired up a perpetual message to show how we can take advantage of said hook. What we haven't done, though, is implement various message types, allow user input, and display messages based on the result of input the user has provided. But before we do that, we need to add support for the various message types, a class interface that will support each type of message, and the data structures necessary for storing such messages.
Want An Inspirational Quote? There’s Artisan Command For That!
Web-development is not all serious – there are some fun activities too. So let’s have a break from mega-urgent code writing and get some inspiration from our beloved Artisan – with a command “inspire”.
WordPress Plugin Rename Media Files Renames Media Files
It’s surprising but true. You can’t edit the file names of uploaded media from within WordPress. The only way to do so is to delete file by file and re-upload them again after names were changed locally. Today, we’ll change that.
ADR with HTTP Caching
Great conversation with “MatTheCat” on Github today, regarding HTTP caching headers and the ADR pattern.
How PHP Executes – From Source Code to Render
Inspired by a recent article on how Ruby code executes, this article covers the execution process for PHP code.
A Good Pager
I made a list of features that a good data pager should have, implemented them in my search engine and made many screenshots of pagers in other web applications.
Playing with Docker, Silex, Python, Node and WebSockets
I’m learning Docker. In this post I want to share a little experiment that I have done. I know the code looks like over-engineering but it’s just an excuse to build something with docker and containers. Let me explain it a little bit.
Building Your Startup: Preparing for Reminders
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. Every step along the way, I'll release the Meeting Planner code as open-source examples you can learn from. I'll also address startup-related business issues as they arise. In this two-part series, I'll describe how we built the infrastructure for reminders and their delivery. This episode will focus on the infrastructure and user experience behind configuring reminders.
PHP 7 Performance Improvements (5/5): Immutable Arrays
Julien Pauli, PHP contributor and release manager, details what changed between PHP 5 and PHP 7, and how to migrate and make effective use of the language optimisations. All statements are documented with specific examples and Blackfire profiles. Fifth and last episode: Immutable arrays using 1,000 times less memory.
How to Use Old Versions of Laravel Homestead
There are two parts to Homestead: the Vagrant box and the Homestead source code (Homestead app). The Homestead Vagrant box is a snapshot of a pre-configured virtual machine ready to use. This saves you from having to spend time installing things such as PHP, NGINX, etc. We use the Laravel Settler repo to build the Homestead boxes. You have to ensure the version of the Homestead Vagrant box is compatible with the version of the Homestead app you are using. Why would you want to use a previous version? If you are working on a Laravel 5.1 (the latest LTS version) application, you may still be running PHP 5.5. While Homestead development moves forward pretty quickly, you may not be ready to move your clients from PHP 5.5.
We were recently sent a tweet in regard to a text-area client/server-side length validation not correlating. After some detective work we were able to find two issues that could have caused this to occur. In this post I wish to discuss our findings, and how we resolved each issue.
Collection Pipelines in PHP
If you read the book “Refactoring to Collections” or saw screencasts and talks by Adam Wathan about collection pipelines, but do not work with Laravel, you might have asked yourself how to apply these techniques to other PHP applications, for example Magento. If you did not, let me explain collection pipelines first.
Using Guzzle and PHPUnit for REST API Testing
In this post I'll be demonstrating how you can test RESTful APIs in an automated fashion using PHP, by building a testing framework through creative use of two packages – Guzzle and PHPUnit. The resulting tests will be something you can run outside of your API as part of your deployment or CI (Continuous Integration) process.
Symfony Console From the Scratch
Symfony Console is the one package you will probably use to build a PHP CLI app. It's one of the easiest Symfony components. Why? You only create Application class, add your Command class and you are ready to go.