Zend Framework & Linux: semi-auto ZF update

Task: automate ZF updating on server.

Solution:

  1. Create folder ‘/var/www/libraries/ZF-last-stable/’. It will be chosen in all application’s include path in ‘/public/index.php’
  2. Create file ‘update_ZF_1.x.sh’:
    #!/bin/bash
    echo "Downloading new stable ZF";
    zendname="ZendFramework-1.11.1";
    wget "http://framework.zend.com/releases/$zendname/$zendname-minimal.tar.gz";
    echo "Unpacking"
    tar -xvzf "$zendname-minimal.tar.gz";
    echo "Deleting original directroy!";
    rm -r ZF-last-stable;
    mv "$zendname-minimal" "ZF-last-stable";
    exit
    
  3. Call the script in console ‘sh /var/www/libraries/update_ZF_1.x.sh’

What happened: we set necessary ZF version in variable ‘zendname’. Package with this version is downloaded, unpacked. Folder named ‘zf-last-stable’ is being removed. Folder with unpacked ZF renamed to ‘zf-last-stable’

Well, it’s kind of semi-automated. You can use svn to download last stable version to automate process, but in this case Zend_Version shows incorrect version (dev).