Dependency Injection in PHP | Nettuts+

Dependency injection has been a frequent subject of discussion among many corporate developers in the past few years. Many feared that they might sacrifice too much time building their application architecture without doing any real work. In this article, I’ll explain why PHP developers should consider taking advantage of dependency injection, when building large, scalable projects.


Smoothing with Holt-Winter – PHP/ir

In one of his talks at QCon, John Allspaw mentioned using Holt-Winter exponential smoothing on various monitoring instances. Wikipedia has a good entry on the subject, of course, but the basic idea is to take a noisy/spikey time series and smooth it out, so that unexpected changes will stand out even more. That’s often initially done by taking a moving average, so say averaging the last 7 days of data and using that as the current day’s value. More complicated schemes weight that average, so that the older data contributes less.


thenextweb/TNW-Social-Count – GitHub

TNW Social Count is a WordPress plugin that solves the problem of social sharing the proper way. No more third-party scripts that slow down your site and ugly buttons that clutter your design. The plugin has two parts: The backend part saves the number of Twitter retweets, Facebook likes, Google Plus and LinkedIn shares as post_meta information. The frontend part renders a share button on the same fashion as on The Next Web blog.


Five more PHP design patterns

Using design patterns in your PHP code is one way to make your code more readable and maintainable. By using established patterns, you benefit from common design constructs that allow other developers on a team to understand your code’s purpose. It also allows you to benefit from the work done by other designers, so you don’t have to learn the hard lessons of design ideas that don’t work out.


Silex – The PHP micro-framework based on Symfony2 Components

Silex is a PHP microframework for PHP 5.3. It is built on the shoulders of Symfony2 and Pimple and also inspired by sinatra.

A microframework provides the guts for building simple single-file apps. Silex aims to be:

* Concise: Silex exposes an intuitive and concise API that is fun to use.
* Extensible: Silex has an extension system based around the Pimple micro service-container that makes it even easier to tie in third party libraries.
* Testable: Silex uses Symfony2’s HttpKernel which abstracts request and response. This makes it very easy to test apps and the framework itself. It also respects the HTTP specification and encourages its proper use.


Run PHP on the Google App Engine – PHP, Web and IT stuff

GAE will support Java going forward. Unfortunately PHP support on the App Engine is still left as the top item in the wishlist. So until Google announces their official PHP support we have a workaround to run PHP using Quercus. Quercus is basically a 100% Java implementation of the PHP language (requires JDK 1.5). Since the App Engine now supports Java this means we can use Quercus to run PHP scripts on the App Engine.


Writing a PHP daemon application – Simas Toleikis

There is a special group of applications that require a different PHP script execution model. For example:

* A chat server (or any other kind of socket server therefore)
* A HTML5 WebSocket server
* A web crawler, data harvester or any other real-time service

All of the mentioned applications need to be run in the background as daemons – something that PHP was never designed/supposed to be good at. The plain C language is a weapon of choice when it comes to writing a daemon implementation, but then again, if the application in question does not depend on high performance and concurrency – PHP can do the job quite well.

Load More