PageRenderTime 44ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/admin/index.php

https://github.com/pussbb/CI_DEV_CMS
PHP | 166 lines | 31 code | 27 blank | 108 comment | 4 complexity | 9cc307a5eb29b172ca9a56ae3d5e09e3 MD5 | raw file
  1. <?php
  2. /*
  3. *---------------------------------------------------------------
  4. * PHP ERROR REPORTING LEVEL
  5. *---------------------------------------------------------------
  6. *
  7. * By default CI runs with error reporting set to ALL. For security
  8. * reasons you are encouraged to change this when your site goes live.
  9. * For more info visit: http://www.php.net/error_reporting
  10. *
  11. */
  12. error_reporting(E_ALL);
  13. /*
  14. *---------------------------------------------------------------
  15. * SYSTEM FOLDER NAME
  16. *---------------------------------------------------------------
  17. *
  18. * This variable must contain the name of your "system" folder.
  19. * Include the path if the folder is not in the same directory
  20. * as this file.
  21. *
  22. */
  23. $system_path = "../system";
  24. /*
  25. *---------------------------------------------------------------
  26. * APPLICATION FOLDER NAME
  27. *---------------------------------------------------------------
  28. *
  29. * If you want this front controller to use a different "application"
  30. * folder then the default one you can set its name here. The folder
  31. * can also be renamed or relocated anywhere on your server. If
  32. * you do, use a full server path. For more info please see the user guide:
  33. * http://codeigniter.com/user_guide/general/managing_apps.html
  34. *
  35. * NO TRAILING SLASH!
  36. *
  37. */
  38. $application_folder = "../admin";
  39. /*
  40. * --------------------------------------------------------------------
  41. * DEFAULT CONTROLLER
  42. * --------------------------------------------------------------------
  43. *
  44. * Normally you will set your default controller in the routes.php file.
  45. * You can, however, force a custom routing by hard-coding a
  46. * specific controller class/function here. For most applications, you
  47. * WILL NOT set your routing here, but it's an option for those
  48. * special instances where you might want to override the standard
  49. * routing in a specific front controller that shares a common CI installation.
  50. *
  51. * IMPORTANT: If you set the routing here, NO OTHER controller will be
  52. * callable. In essence, this preference limits your application to ONE
  53. * specific controller. Leave the function name blank if you need
  54. * to call functions dynamically via the URI.
  55. *
  56. * Un-comment the $routing array below to use this feature
  57. *
  58. */
  59. // The directory name, relative to the "controllers" folder. Leave blank
  60. // if your controller is not in a sub-folder within the "controllers" folder
  61. // $routing['directory'] = '';
  62. // The controller class file name. Example: Mycontroller.php
  63. // $routing['controller'] = '';
  64. // The controller function you wish to be called.
  65. // $routing['function'] = '';
  66. /*
  67. * -------------------------------------------------------------------
  68. * CUSTOM CONFIG VALUES
  69. * -------------------------------------------------------------------
  70. *
  71. * The $assign_to_config array below will be passed dynamically to the
  72. * config class when initialized. This allows you to set custom config
  73. * items or override any default config values found in the config.php file.
  74. * This can be handy as it permits you to share one application between
  75. * multiple front controller files, with each file containing different
  76. * config values.
  77. *
  78. * Un-comment the $assign_to_config array below to use this feature
  79. *
  80. */
  81. // $assign_to_config['name_of_config_item'] = 'value of config item';
  82. // --------------------------------------------------------------------
  83. // END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
  84. // --------------------------------------------------------------------
  85. /*
  86. * ---------------------------------------------------------------
  87. * Resolve the system path for increased reliability
  88. * ---------------------------------------------------------------
  89. */
  90. if (realpath($system_path) !== FALSE)
  91. {
  92. $system_path = realpath($system_path).'/';
  93. }
  94. // ensure there's a trailing slash
  95. $system_path = rtrim($system_path, '/').'/';
  96. // Is the system path correct?
  97. if ( ! is_dir($system_path))
  98. {
  99. exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
  100. }
  101. /*
  102. * -------------------------------------------------------------------
  103. * Now that we know the path, set the main path constants
  104. * -------------------------------------------------------------------
  105. */
  106. // The name of THIS file
  107. define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
  108. // The PHP file extension
  109. define('EXT', '.php');
  110. // Path to the system folder
  111. define('BASEPATH', str_replace("\\", "/", $system_path));
  112. // Path to the front controller (this file)
  113. define('FCPATH', str_replace(SELF, '', __FILE__));
  114. // Name of the "system folder"
  115. define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
  116. // The path to the "application" folder
  117. if (is_dir($application_folder))
  118. {
  119. define('APPPATH', $application_folder.'/');
  120. }
  121. else
  122. {
  123. if ( ! is_dir(BASEPATH.$application_folder.'/'))
  124. {
  125. exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
  126. }
  127. define('APPPATH', BASEPATH.$application_folder.'/');
  128. }
  129. /*
  130. * --------------------------------------------------------------------
  131. * LOAD THE BOOTSTRAP FILE
  132. * --------------------------------------------------------------------
  133. *
  134. * And away we go...
  135. *
  136. */
  137. require_once BASEPATH.'core/CodeIgniter'.EXT;
  138. /* End of file index.php */
  139. /* Location: ./index.php */