BUG #18630

php.internals

Pete Dishman

22 years ago
Hi, The fact that require_once()/include_once() are case-sensitive on Windows was reported in bug 18630 http://bugs.php.net/bug.php?id=18630 , however the bug was then just closed as a documentation problem and nothing was changed, which is why I'm sending this here rather than adding to the bug report. Anyway, on systems with case-insensitive file systems this problem effectively makes require_once() useless and means you have to rely on code blocks such as: if (defined("ASRD_INCLUDED")) return; define("ASRD_INCLUDED", TRUE); at the top of every single include file, this is definitely ugly and would be much better replaced by require_once(). Also using this to prevent multiple inclusions still means that the file will be parsed multiple times which is an unnecessary performance drain. From what I can tell of the code in zend_execute.c, fixing this bug is just a matter of taking a copy of the filename and making it lowercase on windows systems before adding it to the EG(included_files) hashtable. Is there any chance this could be fixed before 4.3.4 is released, as it is definitely a bug and not a documentation problem. Cheers, Pete Dishman ------------------------------------------------ Peter Dishman Software Engineer Email: peterd@telephonetics.co.uk Address: Telephonetics, Hamilton House, 111 Marlowes, Hemel Hempstead, Herts. HP1 1BB +44 (0)1442 242 242 Telephonetics - Making Sound Business Sense - www.telephonetics.co.uk Telephonetics ContactPortal (R) available now : www.telephonetics.co.uk/products/product_contactportal.html Intelligent call routing by spoken voice - just say the name and it dials for you. Call me on 01442 242 242 to hear it in action. Arrange flower delivery via local florists using the Telephonetics / Web Florist service on 08450 111 111 www.webflorists.co.uk/find_a_florist.htm Prompt service anywhere in the UK. The disclaimer available at www.telephonetics.co.uk/edisc.html or by sending email to <mailto:email-disclaimer@telephonetics.co.uk>

Derick Rethans

22 years ago
On Wed, 29 Oct 2003, Pete Dishman wrote:
> Hi, > > The fact that require_once()/include_once() are case-sensitive on Windows > was reported in bug 18630 http://bugs.php.net/bug.php?id=18630 , however the > bug was then just closed as a documentation problem and nothing was changed, > which is why I'm sending this here rather than adding to the bug report. > > Anyway, on systems with case-insensitive file systems this problem > effectively makes require_once() useless and means you have to rely on code > blocks such as: > if (defined("ASRD_INCLUDED")) > return; > define("ASRD_INCLUDED", TRUE); > > at the top of every single include file, this is definitely ugly and would > be much better replaced by require_once(). > Also using this to prevent multiple inclusions still means that the file > will be parsed multiple times which is an unnecessary performance drain. > > >From what I can tell of the code in zend_execute.c, fixing this bug is just > a matter of taking a copy of the filename and making it lowercase on windows > systems before adding it to the EG(included_files) hashtable. > > Is there any chance this could be fixed before 4.3.4 is released, as it is > definitely a bug and not a documentation problem.
How is this a BUG? It's just a feature on windows where you have case-insensitive filenames. I fyou want to handle that, just use one style in your code (ie, always lower case). About your sig: "I wonder if I could request that you ditch the ridiculous ten-line .sig? If not completely, then at least from this list? It's the ASCII equivalent of walking out of a public restroom with toilet paper hanging out of the back of your pants. The longer it is, the sillier you look." Derick
-- "Interpreting what the GPL actually means is a job best left to those that read the future by examining animal entrails." ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ International PHP Magazine http://php-mag.net/ -------------------------------------------------------------------------

Andi Gutmans

22 years ago
Hey, I might have fixed this. Can you please check the latest CVS and let me know if it works for you? Thanks, Andi At 03:36 PM 10/29/2003 +0000, Pete Dishman wrote:

Andi Gutmans

22 years ago
Forget it. I screwed up. It doesn't work yet. At 11:12 PM 10/29/2003 +0200, Andi Gutmans wrote:

Andi Gutmans

22 years ago
Okay, it should work now. Please check and let me know. Andi At 11:17 PM 10/29/2003 +0200, Andi Gutmans wrote:

Andi Gutmans

22 years ago
Argh, this only works on Windows 2000 and later or Windows 98 and later. I guess I'll need to #ifdef it somehow. Anyway, I'd still like you to check it as I assume you're not using Windows 95 or NT 4 :) Andi At 11:31 PM 10/29/2003 +0200, Andi Gutmans wrote:

Edin Kadribasic

22 years ago
On Wed, 29 Oct 2003, Andi Gutmans wrote:
> Argh, this only works on Windows 2000 and later or Windows 98 and later. > I guess I'll need to #ifdef it somehow. Anyway, I'd still like you to check > it as I assume you're not using Windows 95 or NT 4 :)
PHP doesn't work on Windows 95 as of 4.3.0, and NT support is becoming incomplete (ext/imap for example does not work on NT). Edin

Alan Knowles

22 years ago
I got 4.3.3 to work on win95 ok... (support of 95 is kind of essential for php-gtk) as _alot_ of offices are still using it.. - If all the user does is type up letters+print documents, where's the cost/benefit in upgrading.. :) Regards Alan Edin Kadribasic wrote:

Wez Furlong

22 years ago
It's the fastcgi stuff that is incompatible with win95 - everything else should still work. The c-client library includes some funky s-channel stuff that might not work under win95 or NT if you don't have a particular version of IE or a service pack installed - I don't know the precise details off the top of my head. --Wez. ----- Original Message ----- From: "Alan Knowles" <alan@akbkhome.com> To: "Edin Kadribasic" <edink@proventum.net> Cc: "Andi Gutmans" <andi@zend.com>; "Pete Dishman" <peterd@telephonetics.co.uk>; <internals@lists.php.net> Sent: Wednesday, October 29, 2003 6:20 PM Subject: Re: [PHP-DEV] BUG #18630
> I got 4.3.3 to work on win95 ok... (support of 95 is kind of essential > for php-gtk) as _alot_ of offices are still using it.. - If all the user > does is type up letters+print documents, where's the cost/benefit in > upgrading.. :) > > Regards > Alan > > Edin Kadribasic wrote: > > >On Wed, 29 Oct 2003, Andi Gutmans wrote: > > > > > > > >>Argh, this only works on Windows 2000 and later or Windows 98 and later. > >>I guess I'll need to #ifdef it somehow. Anyway, I'd still like you to
check

Pete Dishman

22 years ago
Sorry CVS is a bit of a mystery to me, but I tried php-4-win32-STABLE-200310300530.zip from snaps.php.net which didn't work, so I then tried php4-200310300830.tar.gz and built it. There was a link error relating to php_check_open_basedir_ex() but after working round that the test still didn't work. Do I take it I'm downloading the wrong things or will your changes not have propogated through to snaps.php.net yet? and I'm running windows 2000 by the way. Cheers, Pete Dishman "Andi Gutmans" <andi@zend.com> wrote in message news:5.1.0.14.2.20031029233328.032153e8@127.0.0.1...
> Argh, this only works on Windows 2000 and later or Windows 98 and later. > I guess I'll need to #ifdef it somehow. Anyway, I'd still like you to
check

Jani Taskinen

22 years ago
Yes, the fix was put into PHP 5 branch. You tried the wrong snapshots. --Jani On Thu, 30 Oct 2003, Pete Dishman wrote:

Marcus Börger

22 years ago
Hello Jani, Thursday, October 30, 2003, 7:35:48 PM, you wrote:
> Yes, the fix was put into PHP 5 branch. > You tried the wrong snapshots.
> --Jani
> On Thu, 30 Oct 2003, Pete Dishman wrote:
>>Sorry CVS is a bit of a mystery to me, but I tried >>php-4-win32-STABLE-200310300530.zip from snaps.php.net which didn't work, so >>I then tried php4-200310300830.tar.gz and built it. There was a link error >>relating to php_check_open_basedir_ex() but after working round that the >>test still didn't work. >> >>Do I take it I'm downloading the wrong things or will your changes not have >>propogated through to snaps.php.net yet? >>and I'm running windows 2000 by the way. >> >>Cheers, >>Pete Dishman >> >>"Andi Gutmans" <andi@zend.com> wrote in message >>news:5.1.0.14.2.20031029233328.032153e8@127.0.0.1... >>> Argh, this only works on Windows 2000 and later or Windows 98 and later. >>> I guess I'll need to #ifdef it somehow. Anyway, I'd still like you to check >>> it as I assume you're not using Windows 95 or NT 4 :)
Even microsoft has stopped support for those, so why should we care?
-- Best regards, Marcus mailto:helly@php.net

Andi Gutmans

22 years ago
At 09:10 PM 10/30/2003 +0100, Marcus Börger wrote:
> >>"Andi Gutmans" <andi@zend.com> wrote in message > >>news:5.1.0.14.2.20031029233328.032153e8@127.0.0.1... > >>> Argh, this only works on Windows 2000 and later or Windows 98 and later. > >>> I guess I'll need to #ifdef it somehow. Anyway, I'd still like you to > check > >>> it as I assume you're not using Windows 95 or NT 4 :) > >Even microsoft has stopped support for those, so why should we care?
Someone claimed that in the far east Win95 and NT 4 are still popular. I would like to have a discussion here and decide on this issue. We are only talking about the support of our binary distribution. I think I can make the source compatible using #ifdef. Andi

Andi Gutmans

22 years ago
After discussing this with some people I decided to #ifdef this code for beta 2. We need to decide after beta 2 if we want to fix this bug and not officially support Win95 and NT 4 anymore or not. (I think WIn95 doesn't work anymore but NT 4 does). The main problem is that today, and I suspect in the future, we don't have anyone who is willing to create a binary distribution for Win95 and NT 4 (rightly so in my opinion). Andi At 09:35 AM 10/30/2003 +0000, Pete Dishman wrote: