New on DevShed today there's a tutorial looking at using one of the newer features of PHP, closures, as view helpers in a basic templating system.In this two-part tutorial I'll be showing you, in a step-by-step fashion, how to use the goodies offered by closures in the implementation of an object-based, easily extendable template system. This system will allow you to embed anonymous functions easily into template files, and call them as typical view helpers, too.He starts the process of creating the...
In this final post of his series about building a framework on Symfony2 components, Fabien Potencier focuses again on flexibility - allowing you to have more than one front controller with different configurations thanks to dependency injections.Does it means that we have to make a choice between flexibility, customization, ease of testing and not having to copy and paste the same code into each application front controller? As you might expect, there is a solution. We can solve all these issues and some...
Are You a Human
Satiro Array Table
Classes System Pages
Bulk Form Processing
Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a framework for creating test doubles like mock objects through the use of a simple and succint API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate...
This article is part of a series of articles that explains how to create a framework with
the Symfony2 Components:
In the last installment of this series, we have emptied the
Simplex\\Framework class by extending the HttpKernel class from
Symfony. Seeing this empty class, you might be tempted to move some code from
the front controller to it:
On PHPMaster.com today there's a new post from Alejandro Gervasio about a part of the SOLID development methods - the Liskov Substitution Principle - the idea that objects should be replaceable with instances of their subtypes without a change to the architecture of the application.Even when the formal definition of the LSP makes eyes roll back (including mine), at its core it boils down to avoiding brittlely-defined class hierarchies where the descendants expose a behavior radically different from the...
On the PEAR blog today there's an update about the migration over to github that 5 million lines of code has already made:Since October 2011, 5 million lines of the PEAR codebase has shifted to github. Hand in hand with this shift has been the tireless work of Daniel C - someone who brazenly said "I will fix the failing packages!" in the tail end of last year.As a result of his efforts a list has been created of known good packages to use with PHP 5.4. Other results include:
All test infrastructure...
Is it worth the efforts to cache the results of a MySQL query at the client? In most cases the answer is: try it, measure it! Install the development version of the mysqlnd query cache plugin, which can be used with PDO_MySQL, mysqli and mysql. Set three PHP ...
In part eleven of his "Build a Framework on top of Symfony2", Fabien Potencier improves on his earlier versions of the code by adding in the HttpKernel support for handling events and errors that might come up in the application.If you were to use our framework right now, you would probably have to add support for custom error messages. Right now, we have 404 and 500 error support but the responses are hardcoded in the framework itself. Making them customizable is easy enough though: dispatch a new event...
You mean you aren't already attending what will likely be the largest web developer conference in the Western US this year? What are you waiting for? Not sure if it will be worth it? It will be. Oh, it will be...
If you still need some convincing, or if your boss still needs some convincing, here's the top ten reasons you want to be at DrupalCon Denver:
Michael Nitschinger has a new post to his blog looking at using the popular Composer tool for package management together with Lithium to make dependency management simpler.Composer is a command-line tool that helps you manage your application dependencies. It automatically fetches packages, resolves dependencies and is easy to configure. [...] Currently, Lithium doesn't provide Composer packages out of the box, but it's easy to write one.He starts the post with an introduction to using Composer for...
In a new post to his blog Paul Reinheimer talks about replacing sessions with cookies and some of the (security) pitfalls that can come with it.I've seen several instances where people have demonstrated the ease with which encrypted cookies can replace sessions within PHP. Michael Nitschinger wrote a piece recently demonstrating the switch with Lithium, while CodeIgniter does this by default (optionally encrypting). The problem is that while replacing sessions with cookies works, it introduces a few...
On the KingFoo blog today there's an excellent look at everything new coming up in PHP 5.4, the next version of PHP set to be released in early February.
PHP 5.4 will be stable soon.
In this post I'll try to give you an overview and examples of the new PHP 5.4 features. If you want to try out PHP 5.4 (which is currently in RC3), it has to be installed first. I suggest that you try this out on a virtual machine so you don't break your current PHP version.
Improvements on the list include:
Since October 2011, 5 million lines of the PEAR codebase has shifted to github.
Hand in hand with this shift has been the tireless work of Daniel C - someone who brazenly said a€oI will fix the failing packages!a€¯ in the tail end of last year.
Coupling his efforts with a call to arms, we've now seen an evaluation of the Known Good packages against PHP 5.4, and massive input by the community. The net result is as follows:
Releases of Text_LanguageDetect, HTTP2, Net_Growl, Image_QRCode, Tree,...
The PHP.net has announced the availability of the latest Release Candidate in the PHP 5.4.0 series - PHP 5.4.0 RC6:The PHP development team announces the 6th release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. [...] The 6th release candidate focused on improving traits. Please test them carefully and help us to identify bugs in order to ensure that the release is solid and all...
Latest PECL Releases:
The PHP development team announces the 6th
release candidate of PHP 5.4.
PHP 5.4 includes new language features and removes several legacy
(deprecated) behaviours. Windows binaries can be downloaded from the
Windows QA site.
THIS IS A RELEASE CANDIDATE - DO NOT USE IT IN PRODUCTION!.
This is the 6th release candidate. The release candidate phase is intended as
a period of bug fixing prior to the stable release. No new features should
be included before the final version of PHP 5.4.0....
The PHP development team announces the 6th release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. THIS IS A RELEASE CANDIDATE - DO NOT USE IT IN PRODUCTION!. This is the 6th release candidate. The release candidate phase is intended as a period of bug fixing prior to the stable release. No new features should be included before the final version of PHP 5.4.0. The 6th release...
Image via Wikipedia
Back from my extended leave of absence, I'll re-open the dusty cobwebbed depths of this blog to echo the sentiments of Paul Reinheimer in his recent article a€oCookies don't replace Sessionsa€o. The topic is actually an old one since Ruby On Rails has adopted the strategy of storing application session data in cookies by default (take note, performance hounds). The purposes of storing sessions in userland cookies rather than the conventional a€ostick-it-on-the-filesystem/databasea€¯...
A new year begins, so for the ninth year in a row, I'm taking a moment to record, reflect, assess, and aim.
Last year, I described 2010 as a landmark year, and it was. Analog, Mild Bunch, Brooklyn Beta, Mapalong, and PHP Advent. Even without factoring in conferences and such, it was a big year.All of 2010's accomplishments seem trivial when compared to 2011, because in May, Tegan was born.She's eight months old as I write this, and being a father still feels new. Life has changed, and I have a renewed...