2010/6/2 Kornel Lesiński <kor...@aardvarkmedia.co.uk>:
> On 02-06-2010 at 11:10:43 Robert Goldsmith <rgoldsm...@names.co.uk> wrote:
>
>>> Why would someone choose to replace PHPTAL's autoload with something
>>> else? (I'm not implying it's perfect or such, just wondering what problem
>>> would such option solve).
>>
>> If people already have autoloader code and wish to use only one autoloader
>> in their application or if they find the autoloader they are already using
>> conflicts with the phptal one then it would be good to allow them to disable
>> the phptal autoloader.
>
> require_once "PHPTAL.php";
> spl_autoload_unregister(array('PHPTAL','autoload'));
> // if needed: spl_autoload_register('__autoload');
>
> Would that be OK?

Wouldn't that cause issues when PHPTAL needs to load more classes
during the course of the script's execution?

The autoloader stack should not cause any conflicts; if a class can't
be found based on the naming conventions of a particular class loader,
it will go to the next loader.

The argument that one would only want one autoloader is somewhat weak;
some other libraries also use their own loaders, so I see no reason to
resist that for purity sake. I don't mind to be proven wrong though
;-)

The "magic" required to get around my earlier __autoload() issue
should be the only thing that PHPTAL should be concerned about.

>
> --
> regards, Kornel
>
> _______________________________________________
> PHPTAL mailing list
> PHPTAL@lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>



-- 
--
Tjerk

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to