-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
31 lines (25 loc) · 1.17 KB
/
bootstrap.php
File metadata and controls
31 lines (25 loc) · 1.17 KB
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
<?php
(!defined('DS')) ? define('DS', DIRECTORY_SEPARATOR) : null;
(!defined('APP_ROOT')) ? define('APP_ROOT', realpath(__DIR__ . '..' . DS)) : null;
(!defined('APP')) ? define('APP', 'Application') : null;
if (file_exists('vendor' . DS . 'autoload.php')) {
require_once 'vendor' . DS . 'autoload.php';
/**
* If not configured in composer.json
*/
$autoloader = new Attw\Autoloader\Autoloader();
$application = new Attw\Autoloader\Autoloadable\DefaultAutoloadable(APP);
$autoloader->attach($application);
} else {
//Point where is the framework folder
(!defined('ATTW_FOLDER')) ? define('ATTW_FOLDER', realpath(APP_ROOT . DS . '..' . DS . 'framework')) : null;
$autoload = ATTW_FOLDER . DS . 'autoload' . DS . 'autoload_without_composer.php';
if (!file_exists($autoload)) {
throw new Exception('Indicate a valid folder to AttwFramework');
}
require_once $autoload;
}
require_once 'Application' . DS . 'Configurations.php';
require_once 'Application' . DS . 'Configurations' . DS . 'routes.php';
require_once 'Application' . DS . 'Configurations' . DS . 'standart_configs.php';
require_once 'Application' . DS . 'Application.php';