Archive for June, 2010

Remi Woler: Automating form creation with Zend_PDF

Remi has posted a new article on how to automate form creation with Zend_PDF.

After some digging around, I settled on a work-flow where I would create a PDF of an empty form once, use that as a template and use Zend_Pdf to ‘paste’ the text on top of it, saving the end result as a new PDF. Read on for a description of how I achieved this.

He then goes on to show with code samples exactly how to load up a template PDF file into a Zend_PDF instance and then add your own text at specific locations and finally save to a new PDF file.

It’s well worth a read.

Posted by Rob on 17th June 2010 under Around the web | Comments Off

Zend Framework 2 development starting in earnest!

The git repository for Zend Framework 2.0 is now available at http://git.zendframework.com/.

Matthew posted the following to the ZF contributors mailing list:

the Git repository is now created and ready to clone.

You can do so using the following:

   git clone git://git.zendframework.com/zf.git

For right now, we ask that you issue pull requests to myself, Ralph, or Alex; you can do so using the zf-contributors mailing list, or direct contact; whatever works best for you. When you do so, either do so by using “git send-email” or indicating the URL of your repository and the branch and/or revisions to pull.

If you want your changes pulled you also need to ensure that the user.email configuration in your clone matches the email address with which you are registered in JIRA. You can find full details here:

   http://short.ie/zf2-git-readme

If you want to track commits, you have three methods:

  • viewgit: http://git.zendframework.com/?a=summary&p=zf
  • RSS feed: http://git.zendframework.com/feeds/master.xml
  • Email: send an email to zf-git-subscribe@lists.zend.com

We have a few TODOs left open with the Git repository:

  • Establishing a mirror on Github. I have a request in to the folks at Github currently, and hope we can make some arrangement very soon.
  • Establishing a read-only SVN repository mirroring ZF2 development
  • Establishing methodologies around including ZF2 in your Git projects. I have some ideas on this, and have one tested approach ready to implement if I can’t find something simpler. Until the MVC is migrated to namespaces, however, this is not as imperative.
  • Splitting out the documentation into a separate repo (will make it potentially possible to license docs separately, and thus ease contributions)

If you want to be involved, now is the time! For right now, we particularly encourage working on Service components (any that don’t get migrated to namespaces get axed, with a few exceptions), and non-MVC components (the MVC components still need to be migrated to namespaces, which is a task myself and my team will be doing over the next 2-3 weeks).

Ask around on the list or in IRC to find out who is working on what so you can collaborate, and start feeding us patches!

Thanks everyone for your input and patience over the past few months, and I look forward to your participation in ZF2 development!

Now’s the time to learn git and start looking over the code!

Update

The ZF2 repository is now mirroed on github here: http://github.com/zendframework/zf2

Posted by Rob on 4th June 2010 under Around the web | Comments Off

Chris Hartjes Blog: Testing Controllers Hiding Behind Zend_Auth

Chris Hartjes has written an article on how to test Zend Framework controllers which are protected by Zend_Auth.

I found quite a few examples on how to test a controller, using the $this->dispatch(‘/path/to/action’) method but found that I wasn’t getting redirected properly to the post-login page. I was passing proper credentials in and everything. Then finally after deciding to go back to basics and read up on just how to test Zend_Auth. After some swearing a few face-palms, I realized what I had been doing wrong.

The then goes on to explain how you should do it by ensuring that the unit test logs in via Zend_Auth and provides code to show how it all fits together.

Posted by Rob on 3rd June 2010 under Around the web | Comments Off