---------- Forwarded message ----------
From: Rafael Diaz-Tushman from Dioscouri <rdiaztush...@dioscouri.com>
Date: 26 Nov 2009, 09:21
Subject: JLoader::import
To: Joomla! CMS Development
I will attempt to recreate it with one of the core helper files and a
system plugin for you. I'll get it to you after the holiday. Cheers.
On Nov 24, 8:09 pm, Andrew Eddie <mambob...@gmail.com> wrote:
> Sorry, there must be a "bug" somewhere else.
> Can you give me an example of where you can get a duplicate
> declaration happening?
> Regards,
> Andrew Eddiehttp://www.theartofjoomla.com-the art of becoming a Joomla developer
> 2009/11/25 Andrew Eddie <mambob...@gmail.com>:
> > Hi Rafael.
> > I stumbled upon a comment from Greg Beaver last night which sums up
> > why you should use include:
> >http://www.sitepoint.com/blogs/2009/07/15/how-to-use-php-namespaces-p...
> > If you are getting duplicate declarations then we need to see why that
> > is happening becauseJLoader::import is not supposed to be loading
> > something more than once. In other words, include is fine but there
> > must be a but somewhere else.
> > Regards,
> > Andrew Eddie
> >http://www.theartofjoomla.com-the art of becoming a Joomla developer
> > 2009/11/25 Rafael Diaz-Tushman from Dioscouri <rdiaztush...@dioscouri.com>:
> >> In the context of Joomla 1.5, which (as I understand it) is going to
> >> maintain PHP4 compatibility, is there a particular reason why
> >>JLoader::import uses an include statement as opposed to either of the
> >> _once statements (include_once or require_once)?
> >> The include statement causes issues (double declarations) when a
> >> plugin/module usesJLoader::import to include a class file that is
> >> later also included viaJLoader::import in a component.
> >> This could be resolved by changing line 80 of /libraries/joomla/
> >> loader.php to include_once instead of include
> >> Opposition to the idea seems to stem from a supposed performance hit
> >> that include_once suffers vs include, but I can't find published tests
> >> that substantiate the claim of a performance hit. Additionally, when
> >> thinking logically about the difference in execution time/memory usage
> >> this might actually cause, I think it is negligible compared to the
> >> cost (a PHP Warning).
> >> Then again, I also don't mind typing include_once (or require_once) as
> >> opposed toJLoader::import() -- it's just that when writing for