This is a kind of follow-up to my recent article on Essential Sublime Text 3 Plugins for PHP Developers to explain how to install and configure Sublime-phpcs for the CakePHP code standard. Although I’m describing how to configure phpcs specifically for Cake it will hopefully be of use to anyone wanting to get started with phpcs in Sublime Text and start developing better code.
Sublime Text has got to be one of the most popular text editors out there for coding. Although still in beta, Sublime Text 3 is a relatively stable and very usable. I’ve personally been successfully using it for over 2 years now both at work and at home. It’s sophisticated, lightweight and easy to use. It also works on all the major platforms: Windows, OSX and Linux.
Sublime Text is not quite an IDE (Integrated Development Environment), but with the installation of a handful of packages/plugins you can really make it the ideal editor for developing PHP in.
Sometimes when a user requests to download a file from your app you may want to run some pre-download logic. For example, you may want to check that the user is authenticated or perhaps log the download. Since CakePHP 2.3 this can be simply achieved using CakeResponse.
Good explanation of the composer.lock file and the difference between
composer install and
Comparison of parameters for the
strftime() methods in PHP.
I was asked the other day what’s the difference between
require in PHP. They seemingly function the same but there is a significant difference.
A simple method for recursively deleting a directory and all its content in PHP.
Generating a downloadable CSV file in CakePHP seems to be a bit of a stumbling block for many relatively new to using Cake. It doesn’t need to be challenging. There’s just a few basic steps you need to put in place.
As an example we’ll consider a Subscriber model that contains contact details of people who have subscribed to our app. We want to create a CSV export of all the subscribers data.
A simple little PHP method for returning only the entries within an array that have array keys in a whitelist.
Facebook have released a new programming language based on PHP called Hack. Basically it appears to work much like PHP, but with static typing.
Today we’re releasing Hack, a programming language we developed for HHVM that interoperates seamlessly with PHP. Hack reconciles the fast development cycle of PHP with the discipline provided by static typing, while adding many features commonly found in other modern programming languages.
Looks interesting. Although I’m not all that keen on the name.