__autoload() lowercase

php.internals

Eduardo R. Maciel

22 years ago
We run into a problem, when tryng to organize class files since autoload always uses lowercase. My class file, for example, is named ArrayIterator.class.php (as the class ArrayIterator ) but I get the following error when trying to autoload the class: Warning: __autoload(/usr/local/apache2/htdocs/teste/fw/arrayiterator.class.php): failed to open stream: No such file or directory in /usr/local/apache2/htdocs/teste/fw/teste.php on line 14 Fatal error: __autoload(): Failed opening required '/usr/local/apache2/htdocs/teste/fw/arrayiterator.class.php' (include_path='.:/usr/local/php/lib/php') in /usr/local/apache2/htdocs/teste/fw/teste.php on line 14 looks like it is not fixed in beta2. thanks, Eduardo. __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree

Andi Gutmans

22 years ago
Yeah, this is something we need to tackle. i think we're going to have to keep the pretty case version but it's going to be a slight hit in performance. Remember if anyone has posted a patch for this in the past? If not I'll try and look into fixing it tomorrow. Andi At 09:42 AM 11/18/2003 -0800, Eduardo R. Maciel wrote:

Timm Friebe

22 years ago
On Tue, 2003-11-18 at 23:01, Andi Gutmans wrote:
> Yeah, this is something we need to tackle. i think we're going to have to > keep the pretty case version but it's going to be a slight hit in performance. > Remember if anyone has posted a patch for this in the past?
I did: http://zend.com/lists/engine2/200306/msg00056.html - Ti "don't know if this still works" mm

Eduardo R. Maciel

22 years ago
> --- Timm Friebe <thekid@thekid.de> wrote: > > Andi Gutmans wrote: > > Remember if anyone has posted a patch for this in > > the past? > > I did: > http://zend.com/lists/engine2/200306/msg00056.html
How about Marcus ideia???????? http://zend.com/lists/engine2/200306/msg00078.html __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/

Andi Gutmans

22 years ago
Yes, this is definitely a problem. Today, when possible, we lowercase the class at compile-time so that we save time during execution. Supporting this will lead to a small slow down. I tend to agree that __autoload() should support this but I'm not sure if we should change everything to run-time or maybe hold a second copy. I need to sleep on it. Andi At 09:42 AM 11/18/2003 -0800, Eduardo R. Maciel wrote:

Eduardo R. Maciel

22 years ago
Well, At the point the classname is passed to __autoload is it already in lowercase??? If not, maybe you could just do a single stat in the file the way it is defined in the __autoload() function, with no sanity checks (to avoid performance loss) and include it. And warn users about it on Documentation. --- Andi Gutmans <andi@zend.com> wrote:
> Yes, this is definitely a problem. Today, when > possible, we lowercase the > class at compile-time so that we save time during > execution. Supporting > this will lead to a small slow down. > I tend to agree that __autoload() should support > this but I'm not sure if > we should change everything to run-time or maybe > hold a second copy. > I need to sleep on it. > > Andi > > At 09:42 AM 11/18/2003 -0800, Eduardo R. Maciel > wrote: > > >We run into a problem, when tryng to organize class > >files since autoload always uses lowercase. > > > >My class file, for example, is named > >ArrayIterator.class.php (as the class ArrayIterator > ) > >but I get the following error when trying to > autoload > >the class: > > > >Warning: > >__autoload(/usr/local/apache2/htdocs/teste/fw/arrayiterator.class.php): > >failed to open stream: No such file or directory in > >/usr/local/apache2/htdocs/teste/fw/teste.php on > line > >14 > > > >Fatal error: __autoload(): Failed opening required > >'/usr/local/apache2/htdocs/teste/fw/arrayiterator.class.php' > >(include_path='.:/usr/local/php/lib/php') in > >/usr/local/apache2/htdocs/teste/fw/teste.php on > line > >14 > > > >looks like it is not fixed in beta2. > > > >thanks, > >Eduardo. > > > >__________________________________ > >Do you Yahoo!? > >Protect your identity with Yahoo! Mail AddressGuard > >http://antispam.yahoo.com/whatsnewfree > > > >-- > >PHP Internals - PHP Runtime Development Mailing > List > >To unsubscribe, visit: http://www.php.net/unsub.php >
__________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree

Andi Gutmans

22 years ago
At 11:09 AM 11/19/2003 -0800, Eduardo R. Maciel wrote:
>Well, > > At the point the classname is passed to __autoload >is it already in lowercase???
Yes it's already lowercase. We will need to keep it case-sensitive until this stage. Might not be too bad because I have thought of a way of improving the lower casing in lots of places which will even out things and things might not be slower after all. Andi

Jani Taskinen

22 years ago
On Wed, 19 Nov 2003, Andi Gutmans wrote:
>At 11:09 AM 11/19/2003 -0800, Eduardo R. Maciel wrote: >>Well, >> >> At the point the classname is passed to __autoload >>is it already in lowercase??? > >Yes it's already lowercase. >We will need to keep it case-sensitive until this stage. Might not be too >bad because I have thought of a way of improving the lower casing in lots >of places which will even out things and things might not be slower after all.
Would this problem even exist if everything was case-sensitive..? (Sorry, just couldn't resist.. :) --Jani

Derick Rethans

22 years ago
On Wed, 19 Nov 2003, Andi Gutmans wrote:
> Yes, this is definitely a problem. Today, when possible, we lowercase the > class at compile-time so that we save time during execution. Supporting > this will lead to a small slow down. > I tend to agree that __autoload() should support this but I'm not sure if > we should change everything to run-time or maybe hold a second copy. > I need to sleep on it.
AFAIK Marcus already has a way of showing the upper case class name... perhaps he can tell a bit more about it? Derick