Thanks,
Same thing was apparently possible to do using _initFrontController()
method.
I finally got A LOT progress... But as always, there's the next problem.
My directory structure for my ModuleX is following:
application
modules
modulex
controllers
models
DbTable
Row
Example.php << Modulex_Model_DbTable_Row_Example << it's not
known by autoloader
Example.php << Modulex_Model_DbTable_Example << get's loaded by
autoloader
Example.php << Modulex_Model_Example << get's loaded by autoloader
I tried following in _initModule() method in my module's bootstrap
$this->getResourceLoader()
->addResourceType(
'row',
'models/DbTable/Row',
'Model_DbTable_Row'
);
br, Marko
keith Pope-4 wrote:
>
> You need to register the frontcontroller bootstrap class resource, see
> below:
>
> There is a post here about it: http://akrabat.com/
>
> I am using this .ini file:
>
> [bootstrap]
> autoloadernamespaces.0 = "Zend_"
> autoloadernamespaces.1 = "SF_"
>
> phpsettings.display_errors = 0
> phpsettings.error_reporting = 8191
> phpsettings.date.timezone = "Europe/London"
>
> bootstrap.path = APPLICATION_PATH"/bootstrap/Bootstrap.php"
>
> resources.frontcontroller.moduledirectory = APPLICATION_PATH"/modules"
> resources.frontcontroller.defaultmodule = "storefront"
> resources.frontcontroller.throwerrors = false
> resources.frontcontroller.params.prefixDefaultModule = true
>
> resources.db.adapter = "PDO_MYSQL"
> resources.db.isdefaulttableadapter = true
> resources.db.params.dbname = "storefront"
> resources.db.params.username = "root"
> resources.db.params.password = "root"
> resources.db.params.hostname = "localhost"
> resources.db.params.driver_options.1002 = "SET NAMES UTF8;"
>
> [production : bootstrap]
>
> [development : bootstrap]
> phpsettings.display_errors = 1
> resources.frontcontroller.throwerrors = true
>
> [test : bootstrap]
>
> And this:
>
> <?php
> $paths = array(
> get_include_path(),
> '../library/Incu',
> '../library',
> );
> set_include_path(implode(PATH_SEPARATOR, $paths));
>
> defined('APPLICATION_PATH')
> or define('APPLICATION_PATH', realpath(dirname(__FILE__) .
> '/../application'));
> defined('APPLICATION_ENV')
> or define('APPLICATION_ENV', 'development');
>
> require_once 'Zend/Application.php';
>
> $application = new Zend_Application(
> APPLICATION_ENV,
> APPLICATION_PATH.'/config/store.ini'
> );
> $application->bootstrap();
> $application->run();
>
>
> 2009/4/1 Marko Korhonen <[email protected]>:
>>
>> Hi,
>>
>> I have following error coming from $this->bootstrap('FrontController');
>> calls in Bootstrap.php.
>>
>> Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception'
>> with
>> message 'Resource matching "frontcontroller" not found' in
>> /home/_library_unstable/Zend/Application/Bootstrap/Base.php:518 Stack
>> trace:
>> #0 /home/_library_unstable/Zend/Application/Bootstrap/Base.php(460):
>> Zend_Application_Bootstrap_Base->_executeResource('FrontController') #1
>> /home/_library_unstable/Zend/Application/Bootstrap/Base.php(418):
>> Zend_Application_Bootstrap_Base->_bootstrap('FrontController') #2
>> /home/_applications/apumatti/Bootstrap.php(8):
>> Zend_Application_Bootstrap_Base->bootstrap('FrontController') #3
>> /home/_library_unstable/Zend/Application/Bootstrap/Base.php(503):
>> Bootstrap->_initControllers() #4
>> /home/_library_unstable/Zend/Application/Bootstrap/Base.php(453):
>> Zend_Application_Bootstrap_Base->_executeResource('controllers') #5
>> /home/_library_unstable/Zend/Application/Bootstrap/Base.php(418):
>> Zend_Application_Bootstrap_Base->_bootstrap(NULL) #6
>> /home/_library_unstable/Zend/Application.php(289):
>> Zend_Application_Bootstrap_Base->boot in
>> /home/_library_unstable/Zend/Application/Bootstrap/Base.php on line 518
>>
>> My index.php:
>> ----------------
>> ini_set("display_errors", 1);
>> error_reporting(E_ALL);
>>
>> defined("APPLICATION_PATH") or define("APPLICATION_PATH",
>> "/home/_applications/myapp");
>>
>> defined("APPLICATION_ENV") or define("APPLICATION_ENV", "development");
>>
>> defined("LIBRARY_PATH") or define("LIBRARY_PATH",
>> "/home/_library_unstable");
>>
>> defined("APPLICATION_ENV") or define("APPLICATION_ENV", "development");
>>
>> set_include_path(get_include_path() . PATH_SEPARATOR . LIBRARY_PATH);
>>
>> require_once "Zend/Application.php";
>>
>> $app = new Zend_Application(APPLICATION_ENV, array(
>> "autoloaderNamespaces" => array(
>> "Zend_", "ZendX_", "ZendExt_"
>> ),
>> "bootstrap" => APPLICATION_PATH . "/Bootstrap.php",
> 'resources' => array('frontcontroller' => array(/* Put your
> option here*/))
>> ));
>>
>> $app->bootstrap();
>>
>> $app->run();
>>
>>
>> And my Bootstrap.php:
>> ---------------------------
>> class Bootstrap extends Zend_Application_Bootstrap_Base
>> {
>> protected function _initControllers()
>> {
>> $this->bootstrap('FrontController'); // << Error
>>
>> $this->frontController->addModuleDirectory(APPLICATION_PATH .
>> "/modules");
>> }
>>
>> /*protected function _initRequest()
>> {
>> $this->bootstrap('FrontController'); // << Error
>> $this->request = new Zend_Controller_Request_Http;
>> $this->frontController->setRequest($this->request);
>> return $this;
>> } */
>>
>> protected function _initHelpers(array $options = array())
>> {
>> Zend_Controller_Action_HelperBroker::addHelper(new
>> ZendExt_Controller_Action_Helper_ResourceLoader()); // Copy of Matthew's
>> pastebin resourceloader
>> }
>>
>> protected function _initModules()
>> {
>> $this->bootstrapControllers();
>>
>> $modules = $this->frontController->getControllerDirectory();
>>
>> foreach ($modules as $module => $dir) {
>> if ('default' == $module) {
>> continue;
>> }
>> $bootstrapFile = dirname($dir) . '/Bootstrap.php';
>> $class = ucfirst($module) . '_Bootstrap';
>> if (Zend_Loader::loadFile('Bootstrap.php', dirname($dir))
>> && class_exists($class)
>> ) {
>> $bootstrap = new $class($this);
>> $bootstrap->bootstrap();
>> }
>> }
>> return $this;
>> }
>>
>> public function run()
>> {
>> $this->frontController->dispatch();
>> }
>> }
>>
>>
>> And I have modular directory structure:
>>
>> application
>> modules
>> default
>> controllers
>> views
>> modulex
>> controllers
>> models
>> views
>>
>> etc...
>>
>>
>> Any clues?
>>
>> br, Marko
>> --
>> View this message in context:
>> http://www.nabble.com/Zend_Application-FrontController-bootstrap-problem-tp22824433p22824433.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> ----------------------------------------------------------------------
> [MuTe]
> ----------------------------------------------------------------------
>
>
--
View this message in context:
http://www.nabble.com/Zend_Application-FrontController-bootstrap-problem-tp22824433p22825722.html
Sent from the Zend Framework mailing list archive at Nabble.com.