Re: Potential bug with _cake_core_ caching
Thanks for all the replies :). The posts from the lighthouse ticket describe the exact same situation i was running into. Thanks for the link and the info to fix it. For the topic to not be a bug: Of course duplicate class names in a non namespaced environment are a bad idea, but in CakePHP terms its only critical if you run requestAction between those duplicate controller classes (as euromark mentioned). That's why in my opinion i would call it a bug. Furthermore the plugin prefixing of models, controllers, components,... kind of imitates a namespaced usage and the strict naming of plugins controllers helps to keep the code clean and structured. For example you won't have to rewrite all the different urls for the duplicate controllers. On Sunday, February 26, 2012 8:05:14 PM UTC+1, y2k_2000 wrote: > > > http://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/1884-appload-no-plugin-mapping > > > Plugin objects should be placed under the `Plugin` key of the cache > array. > See App::_map() line 775 (cakephp 2.1) > > Unfortunately, cakephp team keep saying that it's not a bug... > "duplicated class names...bla bla"...and more contradictory arguments > (see App:._loadVendor() line 746) > > --- > > So you will have to fix it by your self, > > Just find this line: > Core/App.php (line ~550) > self::_map($file, $className); > > and replace for this one: > self::_map($file, $className, $plugin); > -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Potential bug with _cake_core_ caching
thing is - the core team is kinda right for all types of classes. well, everything except for controllers. those cannot be used twice in one request of a sane project (assuming there arent any requestActions) so the limitation can probably be modified as y2k_2000 suggested (for controllers) without harming your project just make sure that there are no collisions in your naming of other classes (models, helpers, ...), though. On 26 Feb., 20:05, y2k_2000 wrote: > http://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/1884-... > > Plugin objects should be placed under the `Plugin` key of the cache > array. > See App::_map() line 775 (cakephp 2.1) > > Unfortunately, cakephp team keep saying that it's not a bug... > "duplicated class names...bla bla"...and more contradictory arguments > (see App:._loadVendor() line 746) > > --- > > So you will have to fix it by your self, > > Just find this line: > Core/App.php (line ~550) > self::_map($file, $className); > > and replace for this one: > self::_map($file, $className, $plugin); > > On 26 feb, 16:46, worthy wrote: > > > > > > > > > Hi folks, > > take the following example: > > > x different plugins with a SettingsController and an edit action > > > -> /pluginone/settings/edit > > -> /plugintwo/settings/edit > > -> /pluginthree/settings/edit > > ... > > > I took a look at the _cake_core_ cache and noticed, that a key for the > > first visited SettingsController is stored as only > > "SettingsController" and not "Pluginxxx.SettingsController". > > > So what happens is: If you visit another plugins settings edit action > > the request is routed to the cached SettingsController which is from a > > different plugin. > > > If you disable the _cake_core_ caching the request is routed properly. -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Potential bug with _cake_core_ caching
http://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/1884-appload-no-plugin-mapping Plugin objects should be placed under the `Plugin` key of the cache array. See App::_map() line 775 (cakephp 2.1) Unfortunately, cakephp team keep saying that it's not a bug... "duplicated class names...bla bla"...and more contradictory arguments (see App:._loadVendor() line 746) --- So you will have to fix it by your self, Just find this line: Core/App.php (line ~550) self::_map($file, $className); and replace for this one: self::_map($file, $className, $plugin); On 26 feb, 16:46, worthy wrote: > Hi folks, > take the following example: > > x different plugins with a SettingsController and an edit action > > -> /pluginone/settings/edit > -> /plugintwo/settings/edit > -> /pluginthree/settings/edit > ... > > I took a look at the _cake_core_ cache and noticed, that a key for the > first visited SettingsController is stored as only > "SettingsController" and not "Pluginxxx.SettingsController". > > So what happens is: If you visit another plugins settings edit action > the request is routed to the cached SettingsController which is from a > different plugin. > > If you disable the _cake_core_ caching the request is routed properly. -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Potential bug with _cake_core_ caching
this is a known limitation of cake2. I don't like it either. but thats how App::uses() works... cake3 with namespaces will probably not have issues with this anymore. but until then you need to name the controllers differently. On 26 Feb., 16:46, worthy wrote: > Hi folks, > take the following example: > > x different plugins with a SettingsController and an edit action > > -> /pluginone/settings/edit > -> /plugintwo/settings/edit > -> /pluginthree/settings/edit > ... > > I took a look at the _cake_core_ cache and noticed, that a key for the > first visited SettingsController is stored as only > "SettingsController" and not "Pluginxxx.SettingsController". > > So what happens is: If you visit another plugins settings edit action > the request is routed to the cached SettingsController which is from a > different plugin. > > If you disable the _cake_core_ caching the request is routed properly. -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Potential bug with _cake_core_ caching
Hi folks, take the following example: x different plugins with a SettingsController and an edit action -> /pluginone/settings/edit -> /plugintwo/settings/edit -> /pluginthree/settings/edit ... I took a look at the _cake_core_ cache and noticed, that a key for the first visited SettingsController is stored as only "SettingsController" and not "Pluginxxx.SettingsController". So what happens is: If you visit another plugins settings edit action the request is routed to the cached SettingsController which is from a different plugin. If you disable the _cake_core_ caching the request is routed properly. -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php