Browsed by
Month: May 2018

Dependency Injection

Dependency Injection

Dependency injection is a design pattern which allows you to inject your dependencies into a class, rather than have them loaded from within that class. This blog post on PHP dependency injection will be an example based post without too much commentary from me.   Typically when we write our classes they require functionality from other classes. One way of achieving this is to include and load a new instance of the dependency within our class. Another possibility is that…

Read More Read More

Zend Opcache improves page load speed

Zend Opcache improves page load speed

Zend Opcache in PHP improves your page speed by compiling code into machine code and storing the byte code in RAM. With each subsequent hit to a resource code is served from memory rather than being compiled again. PHP is an interpreted language. What this means is the unlike languages like C / C++, PHP is not compiled once to machine code and then executed from the binary each time. With PHP, each time a page is viewed on your…

Read More Read More

PHP Queues with php-resque

PHP Queues with php-resque

If you’ve been doing PHP development for more than a week you’ll have heard about the benefits of message queues. If you’re totally new to this world and have not heard of queues you should google for more info. At its most basic though a message queue allows your application to offload long running tasks to be completed as background tasks, thus speeding up the front end for your visitors. For instance, on CuteBaby.co.za when a user registers their little…

Read More Read More