Bug #52406 [NEW]: spl_autoload support phar with namespace
| From: | jinmoku at hotmail dot com | Date: | Thu, 22 Jul 2010 14:08:59 +0000 |
| Subject: | Bug #52406 [NEW]: spl_autoload support phar with namespace | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-152617@lists.php.net to get a copy of this message | ||
From:
Operating system:
PHP version: 5.3.3RC3
Package: SPL related
Bug Type: Bug
Bug description:spl_autoload support phar with namespace
Description:
------------
spl_autoload_register don't load namespaces file in phar
Test script:
---------------
---- BEGIN TEST CODE ----
$phar = new Phar('MyPhar.phar');
$index = <<<DOC
<?php
spl_autoload_register();
DOC;
$contents = <<<DOC
<?php
namespace Framework;
class Test
{
public function __construct()
{
echo 'hi';
}
}
DOC;
$phar->addFromString('index.php', $index);
$phar->addFromString('Framework/Test.php', $contents);
require_once('MyPhar.phar');
$test = new Framework\Test();
---- END TEST CODE ----
but this follow code work :
require_once('MyPhar.phar');
require_once('Framework\Test.php');
$test = new Framework\Test();
Expected result:
----------------
hi
Actual result:
--------------
Fatal error: spl_autoload() [function.spl-autoload]: Class Framework\Test
could not be loaded
--
Edit bug report at http://bugs.php.net/bug.php?id=52406&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=52406&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=52406&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=52406&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=52406&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52406&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=52406&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=52406&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=52406&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=52406&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=52406&r=support
Expected behavior: http://bugs.php.net/fix.php?id=52406&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=52406&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=52406&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=52406&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52406&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52406&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=52406&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=52406&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=52406&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=52406&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=52406&r=mysqlcfg