Using application.ini for configuring Zend_Application Bootstrap

sg

New Member
I have written custom resources for my Zend_Application bootstrap.In the manual the following code is given for loading them:\[code\]$application = new Zend_Application(APPLICATION_ENV, array( 'pluginPaths' => array( 'My_Resource' => APPLICATION_PATH . '/resources/', ), 'resources' => array( 'FrontController' => array( 'controllerDirectory' => APPLICATION_PATH . '/controllers', ), ),));\[/code\]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):
  • create an empty project with zf.sh create project (version 1.9.6)
  • make the following class in application/resources/Ftp.php\[code\]class My_Resource_Ftp extends Zend_Application_Resource_ResourceAbstract { protected $_params = array(); public function init() { echo "init invoked"; return array("hey"); }}\[/code\]
  • The following application.ini\[code\][production]phpSettings.display_startup_errors = 0phpSettings.display_errors = 0includePaths.library = APPLICATION_PATH "/../library"bootstrap.path = APPLICATION_PATH "/Bootstrap.php"bootstrap.class = "Bootstrap"pluginPaths.My_Resource = APPLICATION_PATH "/resources/"resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"resources.ftp.username = "me"[staging : production][testing : production]phpSettings.display_startup_errors = 1phpSettings.display_errors = 1[development : production]phpSettings.display_startup_errors = 1phpSettings.display_errors = 1\[/code\]
 
Back
Top