forked from Aeronautics/Spitfire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.php
33 lines (27 loc) · 861 Bytes
/
bootstrap.php
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
26
27
28
29
30
31
32
33
<?php
/* Timezone */
date_default_timezone_set('America/Sao_Paulo');
defined('APPLICATION_ROOT')
|| define('APPLICATION_ROOT', __DIR__);
/* Autoloader */
if (!($autoload = @include __DIR__ . '/vendor/autoload.php')) {
/* Include path */
set_include_path(implode(PATH_SEPARATOR, array(
APPLICATION_ROOT . '/src',
get_include_path(),
)));
/* PEAR autoloader */
spl_autoload_register(
function($className) {
$filename = strtr($className, '\\', DIRECTORY_SEPARATOR) . '.php';
foreach (explode(PATH_SEPARATOR, get_include_path()) as $path) {
$path .= DIRECTORY_SEPARATOR . $filename;
if (is_file($path)) {
require_once $path;
return true;
}
}
return false;
}
);
}