[ Index ]

PHP Cross Reference of GlotPress

title

Body

[close]

/ -> gp-settings.php (source)

   1  <?php
   2  /**
   3   * Used to set up variables, constants and to include the GlotPress
   4   * procedural and class library.
   5   *
   6   * @package GlotPress
   7   * @since 1.0.0
   8   */
   9  
  10  require_once GP_PATH . GP_INC . '/system.php';
  11  
  12  if ( ! defined( 'GP_LOCALES_PATH' ) ) {
  13      define( 'GP_LOCALES_PATH', GP_PATH . 'locales/' );
  14  }
  15  
  16  if ( ! defined( 'DATE_MYSQL' ) ) {
  17      define( 'DATE_MYSQL', 'Y-m-d H:i:s' );
  18  }
  19  
  20  if ( ! defined( 'GP_TESTS_PATH' ) ) {
  21      define( 'GP_TESTS_PATH', GP_PATH . 't/' );
  22  }
  23  
  24  require_once GP_PATH . GP_INC . 'gp.php';
  25  
  26  global $wpdb, $gp_table_prefix;
  27  
  28  if ( ! isset( $gp_table_prefix ) ) {
  29      $gp_table_prefix = $GLOBALS['table_prefix'] . 'gp_';
  30  }
  31  
  32  $table_names = array( 'translations', 'translation_sets', 'glossaries', 'glossary_entries', 'originals', 'projects', 'meta', 'permissions' );
  33  foreach ( $table_names as $table ) {
  34      $wpdb->{'gp_' . $table} = $gp_table_prefix . $table;
  35  }
  36  
  37  if ( defined( 'CUSTOM_PERMISSIONS_TABLE' ) ) {
  38      $wpdb->gp_permissions = CUSTOM_PERMISSIONS_TABLE;
  39  }
  40  
  41  if ( ! defined( 'GP_TMPL_PATH' ) ) {
  42      define( 'GP_TMPL_PATH', GP_PATH . 'gp-templates/' );
  43  }
  44  
  45  require_once GP_PATH . GP_INC . 'meta.php';
  46  require_once GP_PATH . GP_INC . 'misc.php';
  47  require_once GP_PATH . GP_INC . 'url.php';
  48  require_once GP_PATH . GP_INC . 'strings.php';
  49  
  50  require_once GP_PATH . GP_INC . 'template.php';
  51  require_once GP_PATH . GP_INC . 'template-links.php';
  52  
  53  require_once GP_PATH . GP_INC . 'cli.php';
  54  
  55  require_once GP_PATH . GP_INC . 'assets-loader.php';
  56  
  57  require_once GP_PATH . GP_INC . 'rewrite.php';
  58  
  59  require_once GP_PATH . GP_INC . 'default-filters.php';
  60  
  61  require_once ABSPATH . WPINC . '/pomo/mo.php';
  62  require_once ABSPATH . WPINC . '/pomo/po.php';
  63  
  64  if ( ! class_exists( 'GP_Locale' ) || ! class_exists( 'GP_Locales' ) ) {
  65      require_once GP_LOCALES_PATH . 'locales.php';
  66  }
  67  
  68  /*
  69   * We assume all variables set in this file will be global.
  70   * If the file is invoked inside a function, we will lose them all.
  71   * So, make all local variables, global.
  72   */
  73  gp_set_globals( get_defined_vars() );
  74  
  75  require_once GP_PATH . GP_INC . 'warnings.php';
  76  require_once GP_PATH . GP_INC . 'validation.php';
  77  require_once GP_PATH . GP_INC . 'advanced-permissions.php';
  78  
  79  require_once GP_PATH . GP_INC . 'thing.php';
  80  require_once GP_PATH . GP_INC . 'things/original.php';
  81  require_once GP_PATH . GP_INC . 'things/permission.php';
  82  require_once GP_PATH . GP_INC . 'things/project.php';
  83  require_once GP_PATH . GP_INC . 'things/translation-set.php';
  84  require_once GP_PATH . GP_INC . 'things/translation.php';
  85  require_once GP_PATH . GP_INC . 'things/validator-permission.php';
  86  require_once GP_PATH . GP_INC . 'things/administrator-permission.php';
  87  require_once GP_PATH . GP_INC . 'things/glossary.php';
  88  require_once GP_PATH . GP_INC . 'things/glossary-entry.php';
  89  
  90  require_once GP_PATH . GP_INC . 'route.php';
  91  require_once GP_PATH . GP_INC . 'router.php';
  92  
  93  require_once GP_PATH . GP_INC . 'routes/_main.php';
  94  require_once GP_PATH . GP_INC . 'routes/index.php';
  95  require_once GP_PATH . GP_INC . 'routes/original.php';
  96  require_once GP_PATH . GP_INC . 'routes/profile.php';
  97  require_once GP_PATH . GP_INC . 'routes/settings.php';
  98  require_once GP_PATH . GP_INC . 'routes/project.php';
  99  require_once GP_PATH . GP_INC . 'routes/translation-set.php';
 100  require_once GP_PATH . GP_INC . 'routes/translation.php';
 101  require_once GP_PATH . GP_INC . 'routes/glossary.php';
 102  require_once GP_PATH . GP_INC . 'routes/glossary-entry.php';
 103  require_once GP_PATH . GP_INC . 'routes/locale.php';
 104  
 105  
 106  GP::$translation_warnings         = new GP_Translation_Warnings();
 107  GP::$builtin_translation_warnings = new GP_Builtin_Translation_Warnings();
 108  GP::$builtin_translation_warnings->add_all( GP::$translation_warnings );
 109  GP::$router  = new GP_Router();
 110  GP::$formats = array();
 111  
 112  require_once GP_PATH . GP_INC . 'format.php';
 113  require_once GP_PATH . GP_INC . 'formats/format-android.php';
 114  require_once GP_PATH . GP_INC . 'formats/format-pomo.php';
 115  require_once GP_PATH . GP_INC . 'formats/format-resx.php';
 116  require_once GP_PATH . GP_INC . 'formats/format-strings.php';
 117  require_once GP_PATH . GP_INC . 'formats/format-properties.php';
 118  require_once GP_PATH . GP_INC . 'formats/format-json.php';
 119  require_once GP_PATH . GP_INC . 'formats/format-jed1x.php';
 120  require_once GP_PATH . GP_INC . 'formats/format-ngx.php';
 121  
 122  // Let's do it again, there are more variables added since last time we called it.
 123  gp_set_globals( get_defined_vars() );
 124  
 125  GP::$router->set_default_routes();
 126  
 127  if ( ! defined( 'GP_ROUTING' ) ) {
 128      define( 'GP_ROUTING', false );
 129  }
 130  
 131  // Let's check to see if we need to run the upgrade routine but only run it on the admin side.
 132  if ( is_admin() && GP_DB_VERSION > get_option( 'gp_db_version' ) ) {
 133      require_once ABSPATH . 'wp-admin/includes/upgrade.php';
 134      require_once GP_PATH . GP_INC . 'install-upgrade.php';
 135      require_once GP_PATH . GP_INC . 'schema.php';
 136      gp_upgrade_db();
 137  }


Generated: Thu Nov 21 01:01:07 2024 Cross-referenced by PHPXref 0.7.1