Last time, in the Doctrine ORM Repository Hydration article, we discussed how to use the Doctrine ORM to separate our SQL code into a repository layer. This enabled us to pass a strongly typed DTO to the UI layer as opposed to stringly-typed arrays.
This article will be focused on designing phpunit tests for the previous article. We will focus our efforts on these four repository implementations:Continue reading →
With most web applications, there comes a time when your administrative users need reports. These statistics go beyond the typical domain entities and properties that you deal with day-to-day. They consist of aggregate functions (i.e. SUM and MAX) that return numeric scalar values. Lets look at a common MVC solution to expose this data in PHP, and explore how we might refactor that code into something that is maintainable. Our goal is to find the highest quality code that is simple and easy to test.Continue reading →
Writing software that scales with little effort can be a daunting task. The days of "throw hardware at the problem" are here, and managing a web farm with dozens of servers is a real problem for PHP developers. When moving from one to many web servers, the first task is managing PHP session consistency. We will discuss how to accomplish this using the Redis PHP Session Save Handler.Continue reading →
Building scalable and secure e-commerce websites is a complex endeavor. There are enough problems to worry about when managing PCI compliance, firewalls, DDoS attacks, and malicious hackers. Today we are going to tackle the low-hanging fruit that can help you avert fraudulent credit card orders or cyber-attacks from outside your country of origin.Continue reading →
If you work in web development you most likely have suffered through the pains of building your dev environment on more than one occasion. The chances of having dependency problems grow with the size of your team making it difficult to be productive. This is especially true for open source projects when lowering the barrier to entry can net you more contributors. In this post I will walk you through our development environment for Zen Kommerce, an open source e-commerce platform, built in the PHP Kohana framework.Continue reading →
This is an introduction into a basic Comet setup with Nginx and jQuery. You will have to recompile Nginx with NGiNX_HTTP_Push_Module to enable the HTTP Push/Comet functionality. “NHPM” is based on the Basic HTTP Push Relay Protocol and turns Nginx into a very efficient Comet server. This simple recipe will enable you to create live asynchronous web applications utilizing long polling without the complexity of the Bayeux protocol.Continue reading →
This is a common question I used to ask myself at least once a month. It would always be crunch time, and a database table needed to be copied to another server. This is an easy task when the table only has 100 rows… but of course the one in question is 12GB on disk. How do we measure this? How long will this take?Continue reading →
So you have that new gigabit switch and think you are going to achieve 1 Gbps? We all know that you are not going to get 100% throughput due to limitations I will not go into. There could also be a 10/100 patch panel involved that is not rated for gigabit… but, I digress.
I use pipe viewer and netcat to answer this question. To start you will need to install both of these programs and open an available port on the server firewall. I used tcp port 2222 in this example.Continue reading →