[ 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', 'notes', '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 inovked 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  require_once GP_PATH . GP_INC . 'things/note.php';
  90  
  91  require_once( GP_PATH . GP_INC . 'route.php' );
  92  require_once( GP_PATH . GP_INC . 'router.php' );
  93  
  94  require_once GP_PATH . GP_INC . 'routes/_main.php';
  95  require_once GP_PATH . GP_INC . 'routes/index.php';
  96  require_once GP_PATH . GP_INC . 'routes/original.php';
  97  require_once GP_PATH . GP_INC . 'routes/profile.php';
  98  require_once GP_PATH . GP_INC . 'routes/settings.php';
  99  require_once GP_PATH . GP_INC . 'routes/project.php';
 100  require_once GP_PATH . GP_INC . 'routes/translation-set.php';
 101  require_once GP_PATH . GP_INC . 'routes/translation.php';
 102  require_once GP_PATH . GP_INC . 'routes/glossary.php';
 103  require_once GP_PATH . GP_INC . 'routes/glossary-entry.php';
 104  require_once GP_PATH . GP_INC . 'routes/locale.php';
 105  require_once GP_PATH . GP_INC . 'routes/note.php';
 106  
 107  
 108  GP::$translation_warnings = new GP_Translation_Warnings();
 109  GP::$builtin_translation_warnings = new GP_Builtin_Translation_Warnings();
 110  GP::$builtin_translation_warnings->add_all( GP::$translation_warnings );
 111  GP::$router = new GP_Router();
 112  GP::$formats = array();
 113  
 114  require_once GP_PATH . GP_INC . 'format.php';
 115  require_once GP_PATH . GP_INC . 'formats/format-android.php';
 116  require_once GP_PATH . GP_INC . 'formats/format-pomo.php';
 117  require_once GP_PATH . GP_INC . 'formats/format-resx.php';
 118  require_once GP_PATH . GP_INC . 'formats/format-strings.php';
 119  require_once GP_PATH . GP_INC . 'formats/format-properties.php';
 120  require_once GP_PATH . GP_INC . 'formats/format-json.php';
 121  require_once GP_PATH . GP_INC . 'formats/format-jed1x.php';
 122  require_once GP_PATH . GP_INC . 'formats/format-ngx.php';
 123  
 124  // Let's do it again, there are more variables added since last time we called it.
 125  gp_set_globals( get_defined_vars() );
 126  
 127  GP::$router->set_default_routes();
 128  
 129  if ( ! defined( 'GP_ROUTING' ) ) {
 130      define( 'GP_ROUTING', false );
 131  }
 132  
 133  // Let's check to see if we need to run the upgrade routine but only run it on the admin side.
 134  if ( is_admin() && GP_DB_VERSION > get_option( 'gp_db_version' ) ) {
 135      require_once ABSPATH . 'wp-admin/includes/upgrade.php';
 136      require_once GP_PATH . GP_INC . 'install-upgrade.php';
 137      require_once GP_PATH . GP_INC . 'schema.php';
 138      gp_upgrade_db();
 139  }


Generated: Sat Dec 15 01:02:18 2018 Cross-referenced by PHPXref 0.7.1