Events are a great way to separate the business logic of your application and make things simpler and, often, faster. CakePHP framework introduced an events system in version 2.1, and since then it got much better. The official documentation covers current implementation pretty well. But in this post I wanted to link to a few articles that provide more of a historical perspective.
First, goes this blog post by Martin Bean from back in 2013. It shows how things were initially. Even with all the improvements in version 3, the first implementation was still pretty useful.
Second, comes this review of the CakePHP events system (still in version 2), and some profiling of this new functionality. These guys looked at all the details and eventually suggested some improvements.
Their effort didn’t go unnoticed. Mark Story, one of the lead developers of CakePHP framework, wrote this blog post, explaining the upcoming (at the time) changes to the events system in CakePHP version 3.
As a result CakePHP 3 event system is a much simpler and cleaner implementation. Have a look at this guide for a quick introduction.
I’m sure this is not the end of the road, as no software is ever perfect. But it’s a good place to be.
Git hook scripts are useful for identifying simple issues before submission to code review. We run our hooks on every commit to automatically point out issues in code such as missing semicolons, trailing whitespace, and debug statements. By pointing these issues out before code review, this allows a code reviewer to focus on the architecture of a change while not wasting time with trivial style nitpicks.
As we created more libraries and projects we recognized that sharing our pre-commit hooks across projects is painful. We copied and pasted unwieldy bash scripts from project to project and had to manually change the hooks to work for different project structures.
We built pre-commit to solve our hook issues. It is a multi-language package manager for pre-commit hooks. You specify a list of hooks you want and pre-commit manages the installation and execution of any hook written in any language before every commit. pre-commit is specifically designed to not require root access.
Modern browsers offer a variety of security mechanisms for web developers. Unfortunately, some of these aren’t so easy to manage. One needs a deep understanding of the functionality as well as theory behind. Secure Headers is a library that makes all that work a lot easier for PHP developers. Here are some of the features:
Add/remove and manage headers easily
Build a Content Security Policy, or combine multiple together
Content Security Policy analysis
Easy integeration with arbitrary frameworks (take a look at the HttpAdapter)
Protect incorrectly set cookies
Safe mode prevents accidental long-term self-DOS when using HSTS, or HPKP
Receive warnings about missing, or misconfigured security headers
The release of Google Chrome 59 brought some really cool features. One of them in particular was all over the technology news – headless mode. Being able to run the browser engine without the graphical interface, and having control from the command line and API has many benefits.
One of the benefits is being able to take web page screenshots. “Easily convert webpages to images using PHP” is one of the many blogs and articles that explain how to do it, using your preferred programming language (or mine in this case). Browsershot is a very simple PHP library, which you can install with Composer and start using straight away.
I’ve tried it out and it works pretty well. The screenshot above has been taken by the following script:
These are some really good news – Phinx joins CakePHP family! If you are from a different technology stack and not familiar with these, Phinx is an excellent database migrations tool, which has been used by CakePHP framework for a while now. The two worked great together. Now that they are under the same roof, I’m expecting even more goodies!
We are very excited to announce that Phinx has joined the CakePHP team. The Github project has already been moved to the CakePHP organisation. The project itself will stay MIT-licensed but be gradually transformed into a Cake Software Foundation project. Other great news is that the current way to install and update Phinx remains unchanged.
As you are aware, CakePHP has been using Phinx since 3.0.0 for database migrations. The CakePHP Core team welcomes the opportunity to look after and maintain the project and will now start making changes to bring the code in line with the CakePHP (our) coding standards. As well as cleaning up issues and PR’s soon. We will be following up with our plans for the code and setting roadmaps in the coming weeks.
We welcome Phinx to the CakePHP family and hope to see Rob Morgan, Richard Quadling, Woody Gilk around!
Omnipay is a payment processing library for PHP. It has been designed based on ideas from Active Merchant, plus experience implementing dozens of gateways for CI Merchant. It has a clear and consistent API, is fully unit tested, and even comes with an example application to get you started.