Dear all,
I'm using Zend Framework 1.10 with the following index.php file:
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', '/srv/httpd/htdocs/Zend/application');
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ?
getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini');
//$application->bootstrap()->run();
and my indexController.php looks like:
class IndexController extends Zend_Controller_Action
{
public function init()
{
$this->_helper->viewRenderer->setNoRender();
}
public function indexAction()
{
$this->getResponse()->appendBody('Hello from indexAction');
}
}
Also it has application.ini file:
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
[staging : production]
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
But when I debug the script looking at Zend_Application_Bootstrap_Bootstrap class on Bootstrap.php when running its run() function, inside it, Zend_Controller_Front object variable _cotrollerDir is not initialized, whereas bootstrap object ->options->resources->frontController->controllerDirectory is set.
Also I got the following error (exception):
Zend_Controller_Dispatcher_Exception: Invalid controller specified (error) in /var/www/htdocs/Zend/library/Zend/Controller/Dispatcher/Standard.php on line 242
So how come the controller directory is not recognized by Zend_Controller_Front? Any ideas?
Regards,
ethereal1m