Edit report at http://bugs.php.net/bug.php?id=51312&edit=1

 ID:               51312
 User updated by:  whatthejeff at gmail dot com
 Reported by:      whatthejeff at gmail dot com
 Summary:          include_once/require_once are case sensitive on OS X
 Status:           Bogus
 Type:             Bug
 Package:          Scripting Engine problem
 Operating System: Mac OS X 10.6
 PHP Version:      5.3.2

 New Comment:

Alright, no one is saying that's the bug.  The bug is that I can include
the same file multiple times with require_once.  I see what you're
saying about mounting different file systems though.  I understand if
there's no logical solution but maybe a warning could be added to the
docs so that people are aware of this issue.


Previous Comments:
------------------------------------------------------------------------
[2010-06-08 17:41:18] ahar...@php.net

I can't see any logical way of doing this at compile time: individual
file systems within Mac OS X (and, indeed, other non-Windows platforms)
can be case sensitive or insensitive, so while you could theoretically
warn about case sensitive file systems being mounted during compilation,
there's no advantage, since that doesn't guarantee what file systems
will be mounted later. (Plus, plenty of people compile PHP on one system
to use on many, which may themselves have different configurations.)



Bottom line: PHP is case sensitive when the underlying file system is
case sensitive. That's not a bug.

------------------------------------------------------------------------
[2010-06-08 17:36:30] whatthejeff at gmail dot com

Just to be clear, you don't think this is something that could be
detected or specified at compile time?  I have scripts that have worked
across all major platforms for years that suddenly don't work for OS X
and your proposed solution is that if people want require_once to work
as expected on OS X they have to manage it themselves?

------------------------------------------------------------------------
[2010-06-08 14:44:35] tony2...@php.net

It's not reproducible on windows because filesystems there are ALWAYS
case insensitive. But since on Mac it's possible to choose between case
sensitive and case insensitive FS, you have to control this yourself -
there is no way for PHP to 'detect' how exactly the filename should be
used (and even if there is, it would mean a nice performance impact).

In short - this is not PHP problem.

------------------------------------------------------------------------
[2010-03-19 06:09:01] whatthejeff at gmail dot com

Further testing indicates that this bug does not exist for all case
sensitive file systems.  I could not reproduce this error using Windows.

------------------------------------------------------------------------
[2010-03-17 05:36:02] whatthejeff at gmail dot com

Description:
------------
With PHP 5.3.2 on OS X 10.6 I am able to include the same file multiple
times using include_once() and require_once()



Configurations:

--

$ /usr/local/php-test/bin/php -v

PHP 5.3.2 (cli) (built: Mar 16 2010 21:48:40) 



$ /usr/local/php-test/bin/php -i | grep config

Configure Command =>  './configure'  '--prefix=/usr/local/php-test'





Test script:
---------------
$ echo '<?php echo "included\n"; ?>' > test.php

$ php -r 'require_once("test.php"); require_once("Test.php");'



or



$ php -r 'include_once("test.php"); include_once("Test.php");'

Expected result:
----------------
included

Actual result:
--------------
included

included


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51312&edit=1

Reply via email to