Skip to content

Commit 4c83f89

Browse files
committed
Fixed autoloader
1 parent 32eec16 commit 4c83f89

File tree

2 files changed

+23
-14
lines changed

2 files changed

+23
-14
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# dev-master
2-
1+
# 1.0.1 - 2015-02-21
32

3+
* Fixed autoloader
44

55
# 1.0.0 - 2015-02-21

autoloader.php

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,28 @@
44

55
use mageekguy\atoum;
66

7-
require_once __DIR__ . '/vendor/hoa/core/Core.php';
7+
$vendorDirectory = __DIR__ . '/vendor';
8+
9+
if (is_dir($vendorDirectory) === false)
10+
{
11+
$vendorDirectory = __DIR__ . '/../..';
12+
}
13+
14+
if (is_file($vendorAutoloader = $vendorDirectory . '/hoa/core/Core.php')) {
15+
require_once $vendorDirectory . '/hoa/core/Core.php';
16+
}
817

918
atoum\autoloader::get()
1019
->addNamespaceAlias('atoum\ruler', __NAMESPACE__)
11-
->addDirectory(__NAMESPACE__, __DIR__ . DIRECTORY_SEPARATOR . 'classes')
12-
->addDirectory('Hoa\Core', __DIR__ . DIRECTORY_SEPARATOR . 'vendor/hoa/core')
13-
->addDirectory('Hoa\Compiler', __DIR__ . DIRECTORY_SEPARATOR . 'vendor/hoa/compiler')
14-
->addDirectory('Hoa\File', __DIR__ . DIRECTORY_SEPARATOR . 'vendor/hoa/file')
15-
->addDirectory('Hoa\Iterator', __DIR__ . DIRECTORY_SEPARATOR . 'vendor/hoa/iterator')
16-
->addDirectory('Hoa\Math', __DIR__ . DIRECTORY_SEPARATOR . 'vendor/hoa/math')
17-
->addDirectory('Hoa\Regex', __DIR__ . DIRECTORY_SEPARATOR . 'vendor/hoa/regex')
18-
->addDirectory('Hoa\Ruler', __DIR__ . DIRECTORY_SEPARATOR . 'vendor/hoa/ruler')
19-
->addDirectory('Hoa\Stream', __DIR__ . DIRECTORY_SEPARATOR . 'vendor/hoa/stream')
20-
->addDirectory('Hoa\String', __DIR__ . DIRECTORY_SEPARATOR . 'vendor/hoa/string')
21-
->addDirectory('Hoa\Visitor', __DIR__ . DIRECTORY_SEPARATOR . 'vendor/hoa/visitor')
20+
->addDirectory(__NAMESPACE__, __DIR__ . '/classes')
21+
->addDirectory('Hoa\Core', $vendorDirectory . '/hoa/core')
22+
->addDirectory('Hoa\Compiler', $vendorDirectory . '/hoa/compiler')
23+
->addDirectory('Hoa\File', $vendorDirectory . '/hoa/file')
24+
->addDirectory('Hoa\Iterator', $vendorDirectory . '/hoa/iterator')
25+
->addDirectory('Hoa\Math', $vendorDirectory . '/hoa/math')
26+
->addDirectory('Hoa\Regex', $vendorDirectory . '/hoa/regex')
27+
->addDirectory('Hoa\Ruler', $vendorDirectory . '/hoa/ruler')
28+
->addDirectory('Hoa\Stream', $vendorDirectory . '/hoa/stream')
29+
->addDirectory('Hoa\String', $vendorDirectory . '/hoa/string')
30+
->addDirectory('Hoa\Visitor', $vendorDirectory . '/hoa/visitor')
2231
;

0 commit comments

Comments
 (0)