Good day.
I inherited a site on ZendFramework. Part of the site is in the /cms/application/ folder, there are all sorts of configs and the /modules/ folder, some are in the /site/ folder, there are also modules, settings, etc.
The problem is the following: the modules that are in the first folder /cms/appliaction/ (judging by the configuration, this is APPLICATION_PATH), handle errors, i.e. ErrorController.php works here. And what lies in the folder /site/ , the file ErrorController.php does not perceive. The application.ini file at /site/settings/application.ini contains something like the following:
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
phpSettings.date.timezone = "Europe / Moscow"
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/ Bootstrap.php"
autoloaderNamespaces.Zen = "Zen"
installed = true
cache_dir = ROOT_PATH "/ site / cache /"
resources.frontController.controllerDirectory = APPLICATION_PATH "/ modules / pages / controllers"
resources.frontController.moduleDirectory.0 = APPLICATION_PATH "/ modules"
resources.frontController.moduleDirectory.1 = ROOT_PATH "/ site / modules"
resources.frontController.env = APPLICATION_ENV
resources.layout.layoutPath.0 = APPLICATION_PATH "/../res/admin/scripts/"
resources.layout.layoutPath.3 = APPLICATION_PATH "/../res/moder/scripts/"
resources.layout.layoutPath.1 = ROOT_PATH "/ site / theme / scripts /"
resources.layout.layoutPath.2 = ROOT_PATH "/ site / modules /"
resources.view.encoding = "UTF-8"
resources.locale.default = "en_US"
resources.modules [] =
resources.db.adapter = "PDO_MYSQL"
resources.db.isDefaultTableAdapter = true
resources.db.params.charset = "utf8"
I don’t give here the connection to the database. Maybe you need to add something here to get ErrorController.php?
PS IndexController and AdminController in the /site/modules / folder work for all modules, the problem is with ErrorController. Zend Version 1.11.11.
Addition:
Perhaps, I’m mistaken, the only module where I mentioned the 404th page is in the application/modules/pages/views/scripts/error/error.phtml folder. Code insertion is buggy, so here's a screenshot http://joxi.ru/GrqMw4GtYwknrz
What kind of cnf , I did not understand. Moreover, the 404 page appears when accessing the non-existent Action of the Shop module, which generally lies in the /site/modules/shop/ folder and does not have ErrorController.php and errpr.phtml . = (I'm at a loss.
Addition 2:
I found where cnf is defined, this is the file cms/application/Bootstrap.php .
public function _initConfig() { $config = new Zend_Config ( $this->getOptions () ); Zend_Registry::set ( 'cnf', $config ); } But I still wonder why the error.phtml is worth the extra. check of some parameters, and depending on the results of the check, the user sees the 404th error http://joxi.ru/l2ZvyOxfNBqy2J or some other, such as extended information. Shouldn't the ErrorController do this (check the type of the error and throw an exception)?
And even more I do not understand how, by generating an error from the shop module (I just requested a non-existent action), I see the error.phtml described in the pages module (I put http://joxi.ru/a2XVkRnSaJ6erg id = "111" here to make sure that I see error.phtml from the pages module?
error_reporting(E_ALL|E_STRICT|E_WARNING);andini_set('display_errors', true);in the index.php file. Turned on the display of errors in .htaccess. Overloaded the local server and nothing = ( - maler1988