-
- Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathautoload.php
More file actions
25 lines (20 loc) · 520 Bytes
/
autoload.php
File metadata and controls
25 lines (20 loc) · 520 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/*
* This file is part of the Stash package.
*
* (c) Robert Hafner <tedivm@tedivm.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
spl_autoload_register(function ($class) {
$base = '/src/';
if (strpos($class, 'Stash\Test') === 0) {
$base = '/tests/';
}
$file = __DIR__.$base.strtr($class, '\\', '/').'.php';
if (file_exists($file)) {
require $file;
return true;
}
});