Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cakephp doesn't load AclExtras #18

Closed
gkalim opened this issue Jul 15, 2012 · 4 comments
Closed

Cakephp doesn't load AclExtras #18

gkalim opened this issue Jul 15, 2012 · 4 comments

Comments

@gkalim
Copy link

gkalim commented Jul 15, 2012

Hello !

Firstly, I precise i'm a french cooker, so i don't speak english very well.

In the second part of the cookbook 2.0, I have to download the AclExtras plugin. I extract it, I rename the folder name by 'AclExtras' and I put it in www/myProject/plugin.

Next, I add in the bootstrap 'CakePlugin::load('AclExtras')'.
Then, I open my console, and I go in www/myProjet/app and I execute this command : cake AclExtras.AclExtras aco_sync.

I receive an error :
C:\wamp\www\myProject\app> cake AclExtras.AclExtras aco_sync
Fatal error: Class 'Controller' not found in C:\www\wamp\myProject\app\Controller\AppController.php on line 2

Why? I don't understand.

Thank you for your help.

@markstory
Copy link
Owner

Your AppController.php should contain App::uses('Controller', 'Controller');

@gkalim
Copy link
Author

gkalim commented Jul 15, 2012

Wow thanks for your speed. Why do I need App::uses() ? because before I don't need it.

But now, I have :

C:\wamp\www\myProject\app>cake AclExtras.AclExtras aco_sync

Error: Plugin AclExtras could not be found.
#0 C:\wamp\www\CakePHPLib\Cake\Core\App.php(364): CakePlugin::path('AclExtras')
#1 C:\wamp\www\CakePHPLib\Cake\Core\App.php(225): App::pluginPath('AclExtras')
#2 C:\wamp\www\CakePHPLib\Cake\Core\App.php(542): App::path('Console/Command', 'AclExtras')
#3 [internal function]: App::load('AclExtrasShell')
#4 [internal function]: spl_autoload_call('AclExtrasShell')
#5 C:\wamp\www\CakePHPLib\Cake\Console\ShellDispatcher.php(240): class_exists('AclExtrasShell')
#6 C:\wamp\www\CakePHPLib\Cake\Console\ShellDispatcher.php(191): ShellDispatcher->_getShell('AclExtras.AclEx...')
#7 C:\wamp\www\CakePHPLib\Cake\Console\ShellDispatcher.php(69): ShellDispatcher->dispatch()
#8 C:\wamp\www\CakePHPLib\Cake\Console\cake.php(41): ShellDispatcher::run(Array)
#9 {main}

skeleton =
www/myProject
--app
--vendors
--plugins
|--AclExtras
|--Console
|--Test

Thank you ofr reading.

@markstory
Copy link
Owner

Because you do. CakePHP automatically loads Controller during web requests, but the same is not true in unit tests and console applications. You should always import your parents, or things like this can happen.

Sounds like you haven't loaded the plugin.

@gkalim
Copy link
Author

gkalim commented Jul 16, 2012

Ok thank you.
AclExtras could not be found because I put it in /myProject/plugins instead of app/plugin...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants