[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/includes/ -> load-yourls.php (source)

   1  <?php
   2  /* Bootstrap YOURLS
   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,
  14   * are registered in the global scope. If this require is moved in \YOURLS\Config\Config, $yourls_user_passwords for
  15   * instance isn't registered.
  16   */
  17  if (!defined('YOURLS_CONFIGFILE')) {
  18      try {
  19          define('YOURLS_CONFIGFILE', $config->find_config());
  20      } catch (\YOURLS\Exceptions\ConfigException $e) {
  21          die($e->getMessage());
  22      }
  23  }
  24  
  25  require_once YOURLS_CONFIGFILE;
  26  try {
  27      $config->define_core_constants();
  28  } catch (\YOURLS\Exceptions\ConfigException $e) {
  29      die($e->getMessage());
  30  }
  31  
  32  // Initialize YOURLS with default behaviors
  33  
  34  $init_defaults = new \YOURLS\Config\InitDefaults;
  35  new \YOURLS\Config\Init($init_defaults);


Generated: Sun Jun 14 05:10:17 2026 Cross-referenced by PHPXref 0.7.1