Bug #52406 [Com]: spl_autoload support phar with namespace

From: Date: Thu, 10 Feb 2011 20:49:24 +0000
Subject: Bug #52406 [Com]: spl_autoload support phar with namespace
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-158689@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=52406&edit=1 ID: 52406 Comment by: jinmoku at hotmail dot com Reported by: jinmoku at hotmail dot com Summary: spl_autoload support phar with namespace Status: To be documented Type: Bug Package: SPL related Operating System: XP, OSX PHP Version: 5.3.3 Block user comment: N Private report: N New Comment: Add detect_unicode to off for OSX : ini_set('detect_unicode', false); I think all the files should be automatically put in lowercase. Previous Comments: ------------------------------------------------------------------------ [2011-02-09 10:37:10] jinmoku at hotmail dot com Only way to work : $phar->addFromString(strtolower('index.php'), $index); $phar->addFromString(strtolower('Framework/Test.php'), $contents); or maybe do it in internal ------------------------------------------------------------------------ [2010-07-23 11:11:51] jinmoku at hotmail dot com Ok, I retry on XP and it's work, even if it isn't simple, a filename in project is not always in lowercase... Unfortunately it's doesn't work on osx, we see : set_include_path('phar://' . __FILE__ . PATH_SEPARATOR . get_include_path()); but after the require_once the phar path's gone, i'll check on other system and I come back ;) ------------------------------------------------------------------------ [2010-07-23 01:59:42] felipe@php.net What I am saying is: - Using require_once you might use (lowercase not required): $phar->addFromString('Framework/Test.php', $contents); require_once 'Framework/Test.php'; // the search is non-lowercased - Using spl_autoload() you must use (lowercase required): $phar->addFromString('framework/test.php', $contents); $test = new Framework\Test(); // spl_autoload() searchs for the lowercased namespace/classname.php ------------------------------------------------------------------------ [2010-07-23 01:44:48] jinmoku at hotmail dot com oups, caracteres don't passed, you can find the phar here : http://backfront.org/MyPhar.phar ;) ------------------------------------------------------------------------ [2010-07-23 01:36:47] jinmoku at hotmail dot com Do u have a sample code who doesn't work with the lowercase, I want to test in my osx ? about : > I can't reproduce the weird chars... I've this in my phar Extract_Phar::go(); __HALT_COMPILER(); ?>e ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=52406 -- Edit this bug report at http://bugs.php.net/bug.php?id=52406&edit=1

« previous php.bugs (#158689) next »