acl_extras
acl_extras copied to clipboard
ACL not syncing
Hi, I've succesfully setup my ACLs using Cake 2.3, now I just upgraded to Cake 2.5.4 and aco_update / aco_sync stop execution after the first controller with this error:
Error: Class GroupsController does not exist #0 /var/www/www.site.org/net/Plugin/AclExtras/Lib/AclExtras.php(234): ReflectionClass->__construct('GroupsControlle...') #1 /var/www/www.site.org/net/Plugin/AclExtras/Lib/AclExtras.php(271): AclExtras->_getCallbacks('GroupsControlle...') #2 /var/www/www.site.org/net/Plugin/AclExtras/Lib/AclExtras.php(166): AclExtras->_checkMethods('GroupsControlle...', 'Groups', Array, NULL) #3 /var/www/www.site.org/net/Plugin/AclExtras/Lib/AclExtras.php(118): AclExtras->_updateControllers(Array, Array) #4 /var/www/www.site.org/net/Plugin/AclExtras/Lib/AclExtras.php(105): AclExtras->aco_update(Array) #5 /var/www/www.site.org/net/Plugin/AclExtras/Console/Command/AclExtrasShell.php(64): AclExtras->aco_sync(Array) #6 /var/www/www.site.org/lib/Cake/Console/Shell.php(437): AclExtrasShell->aco_sync() #7 /var/www/www.site.org/lib/Cake/Console/ShellDispatcher.php(209): Shell->runCommand('aco_sync', Array) #8 /var/www/www.site.org/lib/Cake/Console/ShellDispatcher.php(66): ShellDispatcher->dispatch() #9 /var/www/www.site.org/net/Console/cake.php(47): ShellDispatcher::run(Array) #10 {main}
This happens also with Cake 2.4.10
Does that controller exist?
Yeah, the controller exists.. it was implemented following the tutorial on cakephp site
It looks like the shell can't find it for some reason then.
It worked well from Cake 2.1 to Cake 2.3.. I think something has changed in Cake 2.4
Any clue?
Not really.
aco_update now prints this line: PHP Notice: Constant DS already defined in /var/www/www.site.org/lib/Cake/Console/ShellDispatcher.php on line 84
then prints the code of the controller it says it doesn't exist and the error above
Received following error with Cake 2.10.9 version when I ran ./Console/cake AclExtras.AclExtras aco_sync though I have DecisionsController in app/Controller. I could not find a solution for this problem in this thread
Error: Class DecisionsController does not exist #0 /conundrum/gotd_vX/app/Plugin/AclExtras/Lib/AclExtras.php(235): ReflectionClass->__construct('DecisionsContro...') #1 /conundrum/gotd_vX/app/Plugin/AclExtras/Lib/AclExtras.php(272): AclExtras->_getCallbacks('DecisionsContro...') #2 /conundrum/gotd_vX/app/Plugin/AclExtras/Lib/AclExtras.php(167): AclExtras->_checkMethods('DecisionsContro...', 'Decisions', Array, NULL) #3 /conundrum/gotd_vX/app/Plugin/AclExtras/Lib/AclExtras.php(119): AclExtras->_updateControllers(Array, Array) #4 /conundrum/gotd_vX/app/Plugin/AclExtras/Lib/AclExtras.php(106): AclExtras->aco_update(Array) #5 /conundrum/gotd_vX/app/Plugin/AclExtras/Console/Command/AclExtrasShell.php(64): AclExtras->aco_sync(Array) #6 /conundrum/gotd_vX/lib/Cake/Console/Shell.php(459): AclExtrasShell->aco_sync() #7 /conundrum/gotd_vX/lib/Cake/Console/ShellDispatcher.php(219): Shell->runCommand('aco_sync', Array) #8 /conundrum/gotd_vX/lib/Cake/Console/ShellDispatcher.php(66): ShellDispatcher->dispatch() #9 /conundrum/gotd_vX/app/Console/cake.php(47): ShellDispatcher::run(Array) #10 {main}
My problem is solved. aco table is populated successfully using AclExtras plugin. The reason behind the problem:- Code of Controller files for example "DecisionsController.php" if was inside just ?> then AclExtras was not able to find these files. When put code inside , then everything was fine.