Archive for the ‘Around the web’ Category

Steve Hollis’ Blog: Practical Nested Transactions with Zend_Db and MySQL

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 »

Writing command line scripts for your ZF application

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 | No Comments »

Zend Framework 1.10.1 Released

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 | No Comments »

Bradley Holt on Zend Framework

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

Zend Framework tips and tricks

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

Active module based config with Zend Framework

BinaryKitten has posted an article on how do module specific bootstrapping within a module’s bootstrap class:

The Concept I wanted to achieve was to have unique Configuration based upon the module that was active. The Issue with this is that the Bootstrap files and the _init functions for ALL modules are called with no bias as to which module is active. Thus if you created a 3 modules wanted to make menu alterations in one, those alterations will be applied to all. I also wanted to have a a system where if i added extra modules i could just add extra functions to the bootstrap file and it would work in a similar way.

She then goes on to post a solution using a front controller plugin that calls back into the currently active module’s bootstrap to execute methods that start with _activeInit.

Go have a read! It’s a nice, extensible solution to the problem

Posted by Rob on 5th January 2010 under Around the web | 1 Comment »

Accessing Zend_Application resources in a controller

Jon Whitcraft has posted an article explaining how to access Zend_Application resources from within a controller. He also points out that retrieving a resource from a module requires a little more work and helpfully provides the code required.

Posted by Rob on 10th December 2009 under Around the web | Comments Off

Zend Framework and Doctrine examples

Juozas Kaziukenas has recently posted some examples of using Zend Framework with Doctrine on his github account.

Visit http://github.com/juokaz/php-examples and have a look!

Posted by Rob on 27th November 2009 under Around the web | Comments Off

Zend Framework and Doctrine

Juozas Kaziukėnas has posted the first part of a series about Zend Framework and Doctrine:

After evaluating possible solutions I decided to stay with Doctrine for a long time. I don’t know any other solution coming, I definitely don’t want (mainly because I don’t have time) to invest on creating my own library and Doctrine is simply awesome when you get used to it. After all this time I can say that it was a right call – Doctrine is on a way to being officially supported in Zend Framework

He then goes on to talk about the benefits of Doctrine and why it can save time. Well worth a read and following the rest of the series.

Posted by Rob on 16th November 2009 under Around the web | Comments Off

Action Delegates

There’s an interesting post over on the mrBurly blog about using action delegates to avoid having duplicate controllers.

One weekend after two years of working with the Zend Framework I threw together a basic application by perfecting one LIST/CRUD controller and then performing your standard copy/paste grepWin replace to create 4 others from it. I may have sensed a better way before that day, but on that day it was obvious that a better way existed. That “better” way in my opinion is the… Delegation Pattern

Definitely well worth having a read.

Posted by Rob on 3rd November 2009 under Around the web | Comments Off

Next »