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):
- create an empty project with zf.sh create project (version 1.9.6)
make the following class in application/resources/Ftp.php
class My_Resource_Ftp extends Zend_Application_Resource_ResourceAbstract { protected $_params = array(); public function init() { echo "init invoked"; return array("hey"); } }
The following application.ini
[production] phpSettings.display_startup_errors = 0 phpSettings.display_errors = 0 includePaths.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 = 1 phpSettings.display_errors = 1 [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1