1 | <?php |
||
2 | /* Bootstrap YOURLS |
||
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
3 | * |
||
4 | * This file initialize everything needed for YOURLS |
||
5 | * If you need to bootstrap YOURLS (ie access its functions and features) simply include this file. |
||
6 | */ |
||
7 | |||
8 | require __DIR__ . '/vendor/autoload.php'; |
||
9 | |||
10 | // Set up YOURLS config |
||
11 | |||
12 | $config = new \YOURLS\Config\Config; |
||
13 | /* The following require has to be at global level so the variables inside config.php, including user defined if any, |
||
0 ignored issues
–
show
|
|||
14 | * are registered in the global scope. If this require is moved in \YOURLS\Config\Config, $yourls_user_passwords for |
||
0 ignored issues
–
show
|
|||
15 | * instance isn't registered. |
||
16 | */ |
||
17 | if (!defined('YOURLS_CONFIGFILE')) { |
||
18 | define('YOURLS_CONFIGFILE', $config->find_config()); |
||
19 | } |
||
20 | require_once YOURLS_CONFIGFILE; |
||
21 | $config->define_core_constants(); |
||
22 | |||
23 | // Initialize YOURLS with default behaviors |
||
24 | |||
25 | $init_defaults = new \YOURLS\Config\InitDefaults; |
||
26 | new \YOURLS\Config\Init($init_defaults); |
||
27 |