Guest User

admin/index.php

a guest
May 22nd, 2015
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.09 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  *---------------------------------------------------------------
  5.  * APPLICATION ENVIRONMENT
  6.  *---------------------------------------------------------------
  7.  *
  8.  * You can load different configurations depending on your
  9.  * current environment. Setting the environment also influences
  10.  * things like logging and error reporting.
  11.  *
  12.  * This can be set to anything, but default usage is:
  13.  *
  14.  *     development
  15.  *     testing
  16.  *     production
  17.  *
  18.  * NOTE: If you change these, also change the error_reporting() code below
  19.  *
  20.  */
  21.         define('ENVIRONMENT', 'development');
  22.         date_default_timezone_set('Asia/Yekaterinburg');
  23. /*
  24.  *---------------------------------------------------------------
  25.  * ERROR REPORTING
  26.  *---------------------------------------------------------------
  27.  *
  28.  * Different environments will require different levels of error reporting.
  29.  * By default development will show errors but testing and live will hide them.
  30.  */
  31.  
  32. if (defined('ENVIRONMENT'))
  33. {
  34.         switch (ENVIRONMENT)
  35.         {
  36.                 case 'development':
  37.                         error_reporting(E_ALL);
  38.                 break;
  39.  
  40.                 case 'testing':
  41.                 case 'production':
  42.                         error_reporting(0);
  43.                 break;
  44.  
  45.                 default:
  46.                         exit('The application environment is not set correctly.');
  47.         }
  48. }
  49.  
  50. /*
  51.  *---------------------------------------------------------------
  52.  * SYSTEM FOLDER NAME
  53.  *---------------------------------------------------------------
  54.  *
  55.  * This variable must contain the name of your "system" folder.
  56.  * Include the path if the folder is not in the same  directory
  57.  * as this file.
  58.  *
  59.  */
  60.         $system_path = $_SERVER['DOCUMENT_ROOT']."/system";
  61.  
  62. /*
  63.  *---------------------------------------------------------------
  64.  * APPLICATION FOLDER NAME
  65.  *---------------------------------------------------------------
  66.  *
  67.  * If you want this front controller to use a different "application"
  68.  * folder then the default one you can set its name here. The folder
  69.  * can also be renamed or relocated anywhere on your server.  If
  70.  * you do, use a full server path. For more info please see the user guide:
  71.  * http://codeigniter.com/user_guide/general/managing_apps.html
  72.  *
  73.  * NO TRAILING SLASH!
  74.  *
  75.  */
  76.         $application_folder = '../application/backend';
  77.  
  78. /*
  79.  * --------------------------------------------------------------------
  80.  * DEFAULT CONTROLLER
  81.  * --------------------------------------------------------------------
  82.  *
  83.  * Normally you will set your default controller in the routes.php file.
  84.  * You can, however, force a custom routing by hard-coding a
  85.  * specific controller class/function here.  For most applications, you
  86.  * WILL NOT set your routing here, but it's an option for those
  87.  * special instances where you might want to override the standard
  88.  * routing in a specific front controller that shares a common CI installation.
  89.  *
  90.  * IMPORTANT:  If you set the routing here, NO OTHER controller will be
  91.  * callable. In essence, this preference limits your application to ONE
  92.  * specific controller.  Leave the function name blank if you need
  93.  * to call functions dynamically via the URI.
  94.  *
  95.  * Un-comment the $routing array below to use this feature
  96.  *
  97.  */
  98.         // The directory name, relative to the "controllers" folder.  Leave blank
  99.         // if your controller is not in a sub-folder within the "controllers" folder
  100.         // $routing['directory'] = '';
  101.  
  102.         // The controller class file name.  Example:  Mycontroller
  103.         // $routing['controller'] = '';
  104.  
  105.         // The controller function you wish to be called.
  106.         // $routing['function'] = '';
  107.  
  108.  
  109. /*
  110.  * -------------------------------------------------------------------
  111.  *  CUSTOM CONFIG VALUES
  112.  * -------------------------------------------------------------------
  113.  *
  114.  * The $assign_to_config array below will be passed dynamically to the
  115.  * config class when initialized. This allows you to set custom config
  116.  * items or override any default config values found in the config.php file.
  117.  * This can be handy as it permits you to share one application between
  118.  * multiple front controller files, with each file containing different
  119.  * config values.
  120.  *
  121.  * Un-comment the $assign_to_config array below to use this feature
  122.  *
  123.  */
  124.         // $assign_to_config['name_of_config_item'] = 'value of config item';
  125.  
  126.  
  127.  
  128. // --------------------------------------------------------------------
  129. // END OF USER CONFIGURABLE SETTINGS.  DO NOT EDIT BELOW THIS LINE
  130. // --------------------------------------------------------------------
  131.  
  132. /*
  133.  * ---------------------------------------------------------------
  134.  *  Resolve the system path for increased reliability
  135.  * ---------------------------------------------------------------
  136.  */
  137.  
  138.         // Set the current directory correctly for CLI requests
  139.         if (defined('STDIN'))
  140.         {
  141.                 chdir(dirname(__FILE__));
  142.         }
  143.  
  144.         if (realpath($system_path) !== FALSE)
  145.         {
  146.                 $system_path = realpath($system_path).'/';
  147.         }
  148.  
  149.         // ensure there's a trailing slash
  150.         $system_path = rtrim($system_path, '/').'/';
  151.  
  152.         // Is the system path correct?
  153.         if ( ! is_dir($system_path))
  154.         {
  155.                 exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
  156.         }
  157.  
  158.  
  159.  
  160. /*
  161.  * -------------------------------------------------------------------
  162.  *  Now that we know the path, set the main path constants
  163.  * -------------------------------------------------------------------
  164.  */
  165.         // The name of THIS file
  166.         define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
  167.  
  168.         // The PHP file extension
  169.         // this global constant is deprecated.
  170.         define('EXT', '.php');
  171.  
  172.         // Path to the system folder
  173.         define('BASEPATH', str_replace("\\", "/", $system_path));
  174.  
  175.         // Path to the front controller (this file)
  176.         define('FCPATH', str_replace(SELF, '', __FILE__));
  177.  
  178.         // Name of the "system folder"
  179.         define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
  180.  
  181.  
  182.         // The path to the "application" folder
  183.         if (is_dir($application_folder))
  184.         {
  185.                 define('APPPATH', $application_folder.'/');
  186.         }
  187.         else
  188.         {
  189.                 if ( ! is_dir(BASEPATH.$application_folder.'/'))
  190.                 {
  191.                         exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
  192.                 }
  193.  
  194.                 define('APPPATH', BASEPATH.$application_folder.'/');
  195.         }
  196.  
  197. /*
  198.  * --------------------------------------------------------------------
  199.  * LOAD THE BOOTSTRAP FILE
  200.  * --------------------------------------------------------------------
  201.  *
  202.  * And away we go...
  203.  *
  204.  */
  205.  
  206. require_once BASEPATH.'core/CodeIgniter.php';
  207.  
  208. /* End of file index.php */
  209. /* Location: ./index.php */
Advertisement
Add Comment
Please, Sign In to add comment