Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/StandardAutoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function setOptions($options)
case self::AUTOREGISTER_ZF:
if ($pairs) {
$this->registerNamespace('Zend', dirname(__DIR__));
$this->registerNamespace('ZendXml', dirname(dirname((__DIR__))) . '/ZendXml');
$this->registerNamespace('ZendXml', dirname(dirname((__DIR__))) . DIRECTORY_SEPARATOR . 'ZendXml');
}
break;
case self::LOAD_NS:
Expand Down
4 changes: 2 additions & 2 deletions test/ClassMapAutoloaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ public function testRegisterRegistersCallbackWithSplAutoload()

public function testCanLoadClassMapFromPhar()
{
$map = 'phar://' . __DIR__ . '/_files/classmap.phar/test/.//../autoload_classmap.php';
$map = 'phar://' . str_replace('/', DIRECTORY_SEPARATOR, __DIR__ . '/_files/classmap.phar/test/.//../autoload_classmap.php');
$this->loader->registerAutoloadMap($map);
$loaded = $this->loader->autoload('some\loadedclass');
$this->assertSame('some\loadedclass', $loaded);
$this->assertTrue(class_exists('some\loadedclass', false));

// will not register duplicate, even with a different relative path
$map = 'phar://' . __DIR__ . '/_files/classmap.phar/test/./foo/../../autoload_classmap.php';
$map = 'phar://' . str_replace('/', DIRECTORY_SEPARATOR, __DIR__ . '/_files/classmap.phar/test/./foo/../../autoload_classmap.php');
$this->loader->registerAutoloadMap($map);
$test = $this->loader->getAutoloadMap();
$this->assertEquals(1, count($test));
Expand Down

0 comments on commit f1cf594

Please sign in to comment.