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
