phpzend-frameworkzend-applicationzend-app-bootstrap

Using application.ini for configuring Zend_Application Bootstrap


I have written custom resources for my Zend_Application bootstrap.

In the manual the following code is given for loading them:

$application = new Zend_Application(APPLICATION_ENV, array(
    'pluginPaths' => array(
        'My_Resource' => APPLICATION_PATH . '/resources/',
    ),
    'resources' => array(
        'FrontController' => array(
            'controllerDirectory' => APPLICATION_PATH . '/controllers',
        ),
    ),
));

This however does not make use of the application.ini which I want to use. Is there a possibility to configure this completely from my application.ini?

My final solution: (with help of Will's answer):


Solution

  • Yes, you just have to use the path to your application.ini as the second argument to the constructor, e.g:

    $application = new Zend_Application(
      APPLICATION_ENV,
      APPLICATION_PATH . '/config/application.ini'
    );
    

    This is the approach the quick start guide takes: http://framework.zend.com/manual/en/zend.application.quick-start.html

    In your .ini file you would then add resource paths like:

    pluginPaths.My_Resource = APPLICATION_PATH "/resources/"
    resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"