Chris Morell has created a bash completion script for Zend Framework.
If you use the Zend Framework CLI interface much you probably find yourself expecting tab-completion to work. Well, with this bash completion script it will.
Once installed, typing “zf cr” followed by a tab will automatically fill in “create” for you. Very handy.
Posted by Rob on 21st March 2010 under Around the web | Comments Off
MSSQL on Linux seems like a bit of a black art at times. Today though, Robert Gonzalez has posted an article on how to build the SQL Server extension for PHP from source on Ubuntu which could make life easier:
the fact remained for me that I had to be able to integrate database communication from LAMP to a SQL Server on Windows [...] the only way to make this happen is to build the SQL Server extension from source.
He then goes on to detail the steps required, starting with building the FreeTDS library, building the PHP extension and configuring it all so that it works.
Posted by Rob on 16th March 2010 under Around the web | 2 Comments »
Juozas Kaziukenas has posted a new article looking at why people seem to believe that Zend Framework is bloated. In Zend Framework is NOT bloated, he says:
Zend Framework is always considered as being the slow/bloated one. I don’t think this is right, so I decided to prove that it’s not correct and in fact ZF is as good as other frameworks are. This post doesn’t cover any benchmarks though; this is more like a architecture review and some misconceptions disproof.
He then goes on to discuss various areas that perceived to be bloated, such as the installation footprint, amount of features and system resource use, looking at why the perception exists and what the reality is.
Posted by Rob on 12th March 2010 under Around the web | Comments Off
Matthew Weier O’Phinney has posted a new article on bootstrapping modules:
When it comes to modules, we have three typical problems or requirements:
- Ensuring that module resources — models, view helpers, etcc. — are available elsewhere in the application
- Initializing module-specific resources, such as routes, navigation elements, etc.
- Running code specific to this module (selecting a specific layout, selecting a specific database adapter, etc)
Zend_Application answers the first two questions. By default, it sets up a resource autoloader with targets for all the common resources (models, forms, view helpers and filters, DbTable objects, etc.), and also allows you to specify resources to load at bootstrap time.
He then goes on to explain what module bootstraps are used for and how to use front controller plugins to handle initialisation tasks if the module is the one being executed.
Posted by Rob on 11th March 2010 under Around the web | Comments Off
Steve Hollis has written an interesting article about how to handle nested transactions with Zend_Db and MySQL.
He starts by covering what transactions are and why they are useful for data integrity, showing how to use them with Zend_Db. He then goes on to talk about the problem of mapping a single transaction across many model objects:
Although transactions are a useful tool, sadly they don’t always fit well into an object oriented application. It’s common to delegate the actual persistence (inserting and updating) of models to a save method which, in turn, goes on to save child objects.
Without ugly hacks which tie the models directly to the database operations, it becomes difficult to establish which object started the transaction and when it should be committed.
In order to help solve these issues, Steve introduces an extended Mysqli adapter for ZendDb that allows for nesting, along with some notes on its usage. Life Steve, I also heartily recommend using ZendDb_Profiler for monitoring your database queries during development.
Go have a read!
Posted by Rob on 5th March 2010 under Around the web | 1 Comment »
With the release of Zend Framework 1.10.2, Matthew Weier O’Phinney announced the kick-off of Zend Framework 2.0 development:
we have branched for development of Zend Framework 2.0 this afternoon. Currently, the branch is intended for development of low-level infrastructure, and we ask that developers have patience; we may be reverting changes frequently as we experiment with some new approaches. I would actually recommend not tracking the branch for a few weeks
The first items to be looked at are:
- Stripping require_once calls
- Updating the test suite:
- Removing the AllTests suites (no longer necessary)
- Usage of TestHelper.php as a PHPUnit bootstrap
- Conversion to namespaces. This will be automated at first, but will then shift to manual changes
- Testing of alternate plugin systems. (To make more explicit for performance and understandability)
Exciting times are upon us!
Posted by Rob on 25th February 2010 under The Book | 2 Comments »
David Caunt has posted an article on how to access your Zend_Application resources from a command line application:
As PHP developers, it is convenient to be able to write command line scripts in PHP. In doing so, you will almost certainly want access to Zend Framework components and their configurations as if you are writing a normal MVC app, but without invoking the MVC stack and without loading unnecessary resources. I’ve seen solutions where actions are exposed as controller actions and called by wget – these are counter-intuitive, inefficient, and will suffer from max execution timeouts and other problems.
He then shows how to write a bootstrap file that only loads the resources required, so you are ready to write a command line script that interacts with you ZF application.
Posted by Rob on 25th February 2010 under Around the web | Comments Off
Over on DevZone, Matthew has announced the release of ZF 1.10.1.
On behalf of the Zend Framework’s many contributors, I’m pleased to announce the immediate availability of Zend Framework 1.10.1, the first maintenance release in our 1.10 series. You can download it from our downloads page:
http://framework.zend.com/download/latest
Also, the Zend Framework manual now supports user comments!
Posted by Rob on 10th February 2010 under Around the web | Comments Off
Bradley Holt recently gave a presentation to his local user group on Zend Framework. He has now posted the slides on his blog along with a sample application, called Postr on github.
He has is now following up with a series of blog posts on aspects of Zend Framework. The first one, Bootstrapping Zend Framework Applications is up and well worth reading.
Posted by Rob on 31st January 2010 under Around the web | Comments Off
Juozas has posted a great article about tips and tricks to consider when developing Zend Framework applications.
He divides his tips into five main areas:
- Separate logic
- Globals
- Use form values, not request
- Do not rely or use exit()/die()
- Use a framework, not PHP
Everyone should read it!
Posted by Rob on 29th January 2010 under Around the web | Comments Off