World of technology loves buzzwords. There is always something new which allegedly is the game changer, and we all should upgrade in the matter of urgency. On the other hand, absorbing new knowledge costs time and effort. It’s difficult to decide which technology is worth sacrificing brain glucose levels.
Continue reading “A painless guide to Apache CouchDB for a PHP developer”
“How do I improve my PHP skills?” is a recurring question on various boards and chats. It’s often asked by newbies but even experienced developers ask themselves the same thing. After all trying to be better is in the human nature. This is a deep question and when you think about it there isn’t a straight forward reply. Nevertheless I will try to give a comprehensive answer which hopefully is going to be useful not only to the beginners but also to the people with some commercial experience.
Continue reading “How to improve PHP programming skills”
In my previous post I showed how to integrate Varnish Cache with a PHP application. The example can solve various simple problems but it might not be enough for a complex software. A good example is a multilingual application. One URL can have multiple caches. You might also need to know more about a user (is he logged in? has he received a notification? etc) to make some additional caching decisions.
Continue reading “Reading PHP session from Varnish Cache”
Varnish Cache is a web application accelerator. It stands in front of a web server and can cache any type of data. It stores data in memory and can speed up your application by a factor of 300-1000x depending on your architecture.
Continue reading “Integrating Varnish Cache with a PHP application”
There are many assumptions around performance of different PHP frameworks. I frequently hear strong opinions about superiority X over Y in this context. There are companies writing new PHP frameworks from scratch because available solutions are too slow for them. What does it really mean? Does the framework performance matters? Before answering this questions lets check how slow is your framework!
Continue reading “Performance benchmark of popular PHP frameworks”
In my previous post I discussed basics of serial communication between Arduino and PHP. Theory behind it is very simple. It all comes down to writing to a file. Simplicity of the serial communication paradoxically might contribute to confusion and surprising results. Serial device is like a black hole when you think about it. You send data inside but there is no feedback. You don’t know has your message arrived or not. You don’t know is your transmission going to be divided into multiple chunks or will arrive at one peace. There is no guarantee no feedback. On top of that there are some differences between operating systems and Arduino peculiarities. All of that combined together can confuse for a few hours or even discourage from the project.
Continue reading “Serial communication between Arduino and PHP with a protocol”
Every application have a bottle neck. It might be a database query, request to an external service, hard drive I/O or an expensive algorithm. Even if the software is running smoothly it might be necessary to optimise in order to handle higher traffic. Significant part of optimisation is caching.
Continue reading “Cache like a Pro with Memcached”
For the last few years I’ve been using virtual machine to keep my dev Linux isolated from my desktop. Recently I decided to improve my test driven development by integrating PHPUnit with Eclipse. I didn’t want to waste time on switching between IDE and console to run a test. The challenge is to create an external tool which will SSH into the remote server, run tests and feedback to Eclipse. In fact this method lets you do anything on the remote server, not only unit test.
Continue reading “Running PHPUnit from Eclipse on a remote system”
Not every problem can be solved with an aid of a cronjob. Sometimes a real time background process is required. The most common approach is to create an ordinary script and run it from command line with “&” character at the end.
Continue reading “PHP Deamon”
A new project created by the ZF command line tool (zf) will have a default IndexControllerTest in the tests folder. The test class inherits from Zend_Test_PHPUnit_ControllerTestCaseand provides a good example of how to test a controller.
Continue reading “Unit testing Zend Framework Models with PHPUnit”