Open GoogleCodeExporter opened 8 years ago
This must be an autoloader issue if you are having to put includes in.
You can see whats registered in the autoloader:
$a = Zend_Loader_Autoloader::getInstance();
var_dump($a->getRegisteredNamespaces());
var_dump($a->getAutoloaders());
This will show you all the configured namespaces such as Zend, SF etc and the
autoloaders you have registered.
Here's my module autoloader for my current project, you should have something
similar.
object(Zend_Application_Module_Autoloader)[15]
protected '_basePath' => string '/home/keith/www/application/modules/max' (length=52)
protected '_components' =>
array
'Max_Model_DbTable' => string '/home/keith/www/application/modules/max/models/DbTable' (length=67)
'Max_Model_Mapper' => string '/home/keith/www/application/modules/max/models/Mapper' (length=66)
'Max_Form' => string '/home/keith/www/application/modules/max/forms' (length=58)
'Max_Model' => string '/home/keith/www/application/modules/max/models' (length=59)
'Max_Plugin' => string '/home/keith/www/application/modules/max/plugins' (length=60)
'Max_Service' => string '/home/keith/www/application/modules/max/services' (length=61)
'Max_View_Helper' => string '/home/keith/www/application/modules/max/views/helpers' (length=66)
'Max_View_Filter' => string '/home/keith/www/application/modules/max/views/filters' (length=66)
'Max_Model_Repository' => string '/home/keith/www/application/modules/max/models/Repository' (length=70)
'Max_Model_Validator' => string '/home/keith/www/application/modules/max/models/Validator' (length=69)
protected '_defaultResourceType' => string 'model' (length=5)
protected '_namespace' => string 'Max' (length=3)
protected '_resourceTypes' =>
array
'dbtable' =>
array
...
'mappers' =>
array
...
'form' =>
array
...
'model' =>
array
...
'plugin' =>
array
...
'service' =>
array
...
'viewhelper' =>
array
...
'viewfilter' =>
array
...
'mapper' =>
array
...
'repository' =>
array
...
'validator' =>
array
...
Original comment by mute.p...@googlemail.com
on 5 Aug 2011 at 11:43
I added:
include_once(APPLICATION_PATH.
"/modules/storefront//models/resources/User/Interface.php");
include_once(APPLICATION_PATH.
"/modules/storefront//models/resources/User.php");
to get chapter 6 to successfully work.
I printed out the dumps of RegisteredNamespaces and Autoloaders;
Except for entries for repository and validator they look like yours(above).
Also I have two identical elements in the autoloader array.
I attach The dumps.
Thanks again
Original comment by ma...@michaelafox.org
on 5 Aug 2011 at 9:32
Attachments:
could you post the contents of your application.ini please, it looks like the
autoloaders are not correct to me, it could be the appnamespace setting....
Original comment by mute.p...@googlemail.com
on 6 Aug 2011 at 1:47
Here is the .ini file
[bootstrap]
Autoloadernamespaces[] = "Zend_"
Autoloadernamespaces[] = "SF_"
phpSettings.display_errors = 0
phpSettings.error_reporting = 8191
phpSettings.date.timezone = "America/Los_Angeles"
bootstrap.path = APPLICATION_PATH "/modules/storefront/Bootstrap.php"
appnamespace="Storefront"
plugin.path = APPLICATION_ROOTY "/../library/SF/Model/Plugin"
resources.frontController.moduledirectory = APPLICATION_PATH "/modules/"
resources.frontController.defaultmodule = "storefront"
resources.frontController.params.prefixDefaultModule = true
resources.frontController.throwexceptions= false
resources.frontController.plugins.action = "SF_Plugin_Action"
resources.frontController.plugins.admin = "SF_Plugin_AdminContext"
resources.db.adapter = "PDO_MYSQL"
resources.db.isdefaulttableadapter = true
resources.db.params.dbname = "storefront"
resources.db.params.username = "root"
resources.db.params.password = ""
resources.db.params.hostname = "localhost"
resources.db.params.charset = "UTF8"
resources.view = ""
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
resources.layout.layout = "main"
resources.modules[] =
product.index = APPLICATION_PATH"/../data/index/product"
errorhandling.graceful = true
[production: bootstrap]
[staging : bootstrap]
[test : bootstrap]
[development : bootstrap]
phpsettings.display_errors = 1
resources.frontController.throwExceptions = false
Original comment by ma...@michaelafox.org
on 6 Aug 2011 at 3:52
Ok, try removing the appnamespace and also do another test with
appnamespace="storefront" instead of "Storefront"
Original comment by mute.p...@googlemail.com
on 6 Aug 2011 at 5:13
appnamespace="storefront" and removing appnamespace both result i the message:
Fatal error: Class 'Storefront_Model_Catalog' not found in D:\PHP
Projects\storeFront\application\modules\storefront\controllers\CategoryControlle
r.php on line 24
line 24 reads $catalogModel = new Storefront_Model_Catalog();
The line numbers are different from yours as I have some logging information
inc;luded.
Original comment by ma...@michaelafox.org
on 6 Aug 2011 at 10:21
Fatal error: Uncaught exception 'Zend_Config_Exception' with message 'Section
'@ENVIRONMENT@' cannot be found in "path/application/config/store.ini". help me!
Original comment by tronga...@gmail.com
on 13 Nov 2012 at 4:42
Original issue reported on code.google.com by
ma...@michaelafox.org
on 4 Aug 2011 at 6:50