aboutsummaryrefslogtreecommitdiff
path: root/includes/load-yourls.php
blob: ae630b165e3a9d6f9cdb78a3c3112d4982876a0e (plain) (blame)
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
<?php
/* Bootstrap YOURLS
 *
 * This file initialize everything needed for YOURLS
 * If you need to bootstrap YOURLS (ie access its functions and features) simply include this file.
 */

require __DIR__ . '/vendor/autoload.php';

// Set up YOURLS config

$config = new \YOURLS\Config\Config;
/* The following require has to be at global level so the variables inside config.php, including user defined if any,
 * are registered in the global scope. If this require is moved in \YOURLS\Config\Config, $yourls_user_passwords for
 * instance isn't registered.
 */
if (!defined('YOURLS_CONFIGFILE')) {
    define('YOURLS_CONFIGFILE', $config->find_config());
}
require_once YOURLS_CONFIGFILE;
$config->define_core_constants();

// Initialize YOURLS with default behaviors

$init_defaults = new \YOURLS\Config\InitDefaults;
new \YOURLS\Config\Init($init_defaults);