aboutsummaryrefslogtreecommitdiff
path: root/includes/load-yourls.php
diff options
context:
space:
mode:
authors1n <[email protected]>2020-03-28 10:36:41 -0700
committers1n <[email protected]>2020-03-28 10:36:41 -0700
commit25b7d2aab61ae6421398d3abae5da6ffe590333d (patch)
tree611985ec78bb2d94099c9fd5dd687f5c9cee6f3e /includes/load-yourls.php
parentInitial commit (diff)
downloadcrack.cf-backup-25b7d2aab61ae6421398d3abae5da6ffe590333d.tar.xz
crack.cf-backup-25b7d2aab61ae6421398d3abae5da6ffe590333d.zip
3/28/2020, 10:36HEADmaster
Diffstat (limited to 'includes/load-yourls.php')
-rw-r--r--includes/load-yourls.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/includes/load-yourls.php b/includes/load-yourls.php
new file mode 100644
index 0000000..ae630b1
--- /dev/null
+++ b/includes/load-yourls.php
@@ -0,0 +1,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);