source code bean

30 Dec, 2009

Upgrading from Zend Framework 1.7 to 1.9 – The autoloader

Posted by: Peter In: PHP| Web| Zend Framework

Today I upgraded a project we started working on last year from Zend Framework 1.7 to Zend Framework 1.9. I excepted to run into several API incompatibilities, but the only problem I got was the autoloader.

In Zend 1.7, and earlier versions, the autoloader was registered like this:

  1.  
  2. require_once "Zend/Loader.php";
  3. Zend_Loader::registerAutoload();
  4.  

In Zend Framwork 1.9 this has changed slightly, you now have to register the namespaces you want to autoload:

  1.  
  2. require_once ‘Zend/Loader/Autoloader.php’;
  3. $loader = Zend_Loader_Autoloader::getInstance();
  4. $loader->registerNamespace(‘Dqc_’);
  5.  

This was the only change we needed to do to upgrade from 1.7 to 1.9, quite impressive!

No Responses to "Upgrading from Zend Framework 1.7 to 1.9 – The autoloader"

Comment Form

Categories

Adwords

Twitter Updates


    • Petan: I got in bootstrap this (insted of $frontController->getRouter()): $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routes.ini', 'rout
    • oanh tong ngoc: :) It's usefull but could U give everyone's an example with a project source code. Thanks
    • Peter: Hi Sohaib, It seems like the rewrite module isn't loaded by IIS. Have you uploaded the UrlRewriter dlls and made the changes to web.config on the ser

    About

    Welcome to source code bean! You will find information on tips and tricks on programming languages, server side stuff, and anything that causes troubles to web development.