RE: [PHP-DEV] REPOST: Class Autoloading [PATCH]
| From: | phpsurf | Date: | Mon, 10 Jun 2002 09:33:58 +0000 |
| Subject: | RE: [PHP-DEV] REPOST: Class Autoloading [PATCH] | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-85083@lists.php.net to get a copy of this message | ||
this patch would be really great !
I can remember it has been discussed a lot on the ZE2 mailing list about the
'import' feature.
some people (and I was) would have apreciated another name because this name
was already used in many PHP frameworks to implement a function that loads
classes.
As far as I followed this thread, the agreement was that the import keyword
can be used fine for namespaces if a autoload statement was patched to the
engine ... so everyone would be happy ! :)
I guess your patch gives some function like this one :
set_classautoload_handler("myAutoLoader");
and then, one can implement a function like this:
myAutoLoader($className) {
if (!class_exists($className)) {
include("class/".str_replace("_", "/",
$className).".php");
}
}
I'm sure many programmers would apreciate such a feature.
Especially as it whould have no BC issue at all !
> -----Original Message-----
> From: Ivan Ristic [mailto:ivanr@webkreator.com]
> Sent: dimanche 9 juin 2002 22:46
> To: Zeev Suraski
> Cc: php-dev@lists.php.net
> Subject: Re: [PHP-DEV] REPOST: Class Autoloading [PATCH]
>
>
> > I believe this has been discussed in the past and not ack'd,
> please read
> > the php-dev archives...
>
> I tried and I tried but I couldn't find a discussion on anything
> similar on the mailing list.
>
> The code I sent is *already* in use, and has been in
> use for some time now. Take a look at this message from
> November 2001:
>
> http://marc.theaimsgroup.com/?l=php-dev&m=100687224711738&w=25…Å9Ç
> Fì0¯áŒè D
>
> I didn't introduce anything new, so if it was OK then it should be
> OK now. Also, the code cannot affect the people that are not using
> the feature so I do not think that there will be any kind of impact
> on the existing user base.
>
> This feature makes it possible to have one class per file and not
> to worry about inclusion at all. It becomes especially useful when
> used together with products such as Zend Accelerator, where files
> are cached (and you do not have to worry about a large number of
> small files).
>
> --
> Ivan Ristic, ivanr@webkreator.com
> [ Weblog on PHP, Software development, Intranets,
> and Knowledge Management: http://www.webkreator.com ]
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif