This website recently got a major rebuild; if you're missing something, let Lorna know.

    Tag: zendframework


  1. Script for Database Patching at Deploy Time


    I've written before about a simple way of patching database versions and there's a much more comprehensive article from Harrie on TechPortal as well. I often find though that projects with patching strategies are missing the scripts to apply these automatically when the code is deployed, so I thought I'd share mine.

    My current project (BiteStats, a simple report of your google analytics data) uses a basic system where there are numbered patches, and a patch_history table with a row for every patch that was run, showing the version number and a timestamp. When I deploy the code to production, I have a script that runs automatically to apply the patches.

    Read more

  2. Dealing with MySQL Gone Away in Zend Framework


    I wrote recently about having gearman in my application, however I have been seeing problems with the long-running PHP worker scripts. My logs had entries like this:

    SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
    

    The worker is a Zend Framework application, run from the CLI, and it …

    Read more

  3. Using Gearman from PHP


    I've introduced Gearman into a project I'm working on, and since a few people have asked I thought I'd share my experiences. Basically, this application generates some PDFs from a variety of data sources, makes images, and emails it. Since the whole data processing, image handling, PDF generation process is fairly heavy, I'm putting the requests to generate these onto a gearman queue and having some workers process the jobs. The eventual aim is to bring up EC2 instances (or php-specific cloud hosting perhaps? Recommendations gratefully received!) to do this work but right now I have one worker and it's all on one server.

    Read more

  4. Adding PUT variables to Request Object in Zend Framework


    When I wrote recently about testing web services within Zend Framework, I missed out a really key piece of information! I didn't explain how I was reading the PUT vars in my controller code in the first place - so I'll rectify that omission now.

    Its very simple: I have extended …

    Read more

  5. Using Zend_Test for Web Services


    Recently I had cause to develop a web service and so I wrote some tests to go along with it - or I was about to. When I looked at the asserts available in Zend_Test, they were all geared towards HTML/CSS output - but we can test just as effectively on …

    Read more

  6. PHPUnit with Zend_Controller_Action_Helper


    I'm currently working on a REST service built in Zend Framework and I ran into problems very quickly - when I tried to write the first unit test for the first action in fact! PHPUnit was just dying when I asked it to dispatch() any URL which didn't return HTML, it …

    Read more

  7. Zend_Paginator on Ibuildings Blog


    In case anyone thought it was a bit quiet around here - that's because I've been working on a few other bits and pieces! Today I posted an article about Zend_Paginator to the Ibuildings blog. Do stop by and have a read - and read the comments as well as there are …

    Read more

  8. Introduction to Zend_Db


    I recently worked on a project which was based on Zend Framework - I haven't worked with it before and I was temporarily confused by the existing implementation of some of the database-level stuff. After much reading and untangling of code, I'm now pretty clear how this should look, so here's …

    Read more