I'm having trouble getting my plugins to load in CakePHP 2.0.0-alpha,
I keep getting missing plugin exceptions unless I call
CakePlugin::load() explicitly...
Fatal Error (256): [MissingPluginException] Test plugin Users could
not be found.
#0 ~/htdocs/lib/Cake/Core/App.php(380): CakePlugin::path('Users')
#1 ~/htdocs/lib/Cake/Core/App.php(221): App::pluginPath('Users')
#2 ~/htdocs/lib/Cake/View/View.php(813): App::path('View', 'Users')
#3 ~/htdocs/lib/Cake/View/View.php(702): View->_paths('users')
#4 ~/htdocs/lib/Cake/View/View.php(390): View-
>_getViewFileName('error500')
#5 ~/htdocs/lib/Cake/Controller/Controller.php(874): View-
>render('error500', NULL)
#6 ~/htdocs/lib/Cake/Error/ExceptionRenderer.php(251): Controller-
>render('error500')
#7 ~/htdocs/lib/Cake/Error/ExceptionRenderer.php(191):
ExceptionRenderer->_outputMessageSafe('error500')
#8 [internal function]: ExceptionRenderer-
>_cakeError(Object(MissingPluginException))
#9 ~/htdocs/lib/Cake/Error/ExceptionRenderer.php(167):
call_user_func_array(Array, Array)
#10 ~/htdocs/lib/Cake/Error/ErrorHandler.php(126): ExceptionRenderer-
>render()
#11 [internal function]:
ErrorHandler::handleException(Object(MissingPluginException))
#12 {main} [CORE/Cake/Error/ErrorHandler.php, line 135]
I have updated my own custom plugin directory structures based on
http://cakephp.lighthouseapp.com/projects/42648/20-class-loading
My plugin directory structure for the Users plugin looks like this:
-app/
--Plugin/
----users
------Controller/
--------UsersAppController.php
------Model/
--------UsersAppModel.php
------View/
Initially I tried keeping UsersAppController.php and UsersAppModel.php
in the root plugin directory but I couldn't find any documentation
about this?
If I call CakePlugin::load('Users') explicitly in bootstrap.php any
plugin views that don't use a model will render, but any action that
reads/writes to the database starts throwing DataSource not found
exceptions.
Any help would be greatly appreciated. Thanks!
Here's a stacktrace:
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment