PageRenderTime 50ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/codefight-cms/codefight/index.php

http://cmsdamu.googlecode.com/
PHP | 220 lines | 54 code | 29 blank | 137 comment | 8 complexity | b765448331151ea699632d4894710656 MD5 | raw file
Possible License(s): CC-BY-SA-3.0, LGPL-2.1, AGPL-1.0, GPL-2.0
  1. <?php
  2. if(is_dir(dirname(__FILE__).'/install'))
  3. die('<p><a href="install">Click here</a> to install or remove install folder</p>');
  4. /*
  5. *---------------------------------------------------------------
  6. * APPLICATION ENVIRONMENT
  7. *---------------------------------------------------------------
  8. *
  9. * You can load different configurations depending on your
  10. * current environment. Setting the environment also influences
  11. * things like logging and error reporting.
  12. *
  13. * This can be set to anything, but default usage is:
  14. *
  15. * development
  16. * testing
  17. * production
  18. *
  19. * NOTE: If you change these, also change the error_reporting() code below
  20. *
  21. */
  22. define('ENVIRONMENT', 'development');
  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. if (defined('ENVIRONMENT'))
  32. {
  33. switch (ENVIRONMENT)
  34. {
  35. case 'development':
  36. error_reporting(E_ALL ^ E_DEPRECATED);
  37. break;
  38. case 'testing':
  39. case 'production':
  40. error_reporting(0);
  41. break;
  42. default:
  43. exit('The application environment is not set correctly.');
  44. }
  45. }
  46. /*
  47. *---------------------------------------------------------------
  48. * SYSTEM FOLDER NAME
  49. *---------------------------------------------------------------
  50. *
  51. * This variable must contain the name of your "system" folder.
  52. * Include the path if the folder is not in the same directory
  53. * as this file.
  54. *
  55. */
  56. $system_path = "CIcore";
  57. /*
  58. *---------------------------------------------------------------
  59. * APPLICATION FOLDER NAME
  60. *---------------------------------------------------------------
  61. *
  62. * If you want this front controller to use a different "application"
  63. * folder then the default one you can set its name here. The folder
  64. * can also be renamed or relocated anywhere on your server. If
  65. * you do, use a full server path. For more info please see the user guide:
  66. * http://codeigniter.com/user_guide/general/managing_apps.html
  67. *
  68. * NO TRAILING SLASH!
  69. *
  70. */
  71. $application_folder = dirname(__FILE__).'/app';
  72. /*
  73. |--------------------------------------------------------------------------
  74. | New Base Site URL
  75. |--------------------------------------------------------------------------
  76. |
  77. | URL of your New Website. Typically this will be your base URL,
  78. | WITH a trailing slash:
  79. |
  80. | http://example.com/
  81. |
  82. */
  83. //define('CFWEBSITE', 'http://local.codefight.org/');
  84. define('CFWEBSITEID', 1);
  85. /*
  86. * --------------------------------------------------------------------
  87. * DEFAULT CONTROLLER
  88. * --------------------------------------------------------------------
  89. *
  90. * Normally you will set your default controller in the routes.php file.
  91. * You can, however, force a custom routing by hard-coding a
  92. * specific controller class/function here. For most applications, you
  93. * WILL NOT set your routing here, but it's an option for those
  94. * special instances where you might want to override the standard
  95. * routing in a specific front controller that shares a common CI installation.
  96. *
  97. * IMPORTANT: If you set the routing here, NO OTHER controller will be
  98. * callable. In essence, this preference limits your application to ONE
  99. * specific controller. Leave the function name blank if you need
  100. * to call functions dynamically via the URI.
  101. *
  102. * Un-comment the $routing array below to use this feature
  103. *
  104. */
  105. // The directory name, relative to the "controllers" folder. Leave blank
  106. // if your controller is not in a sub-folder within the "controllers" folder
  107. // $routing['directory'] = '';
  108. // The controller class file name. Example: Mycontroller.php
  109. // $routing['controller'] = '';
  110. // The controller function you wish to be called.
  111. // $routing['function'] = '';
  112. /*
  113. * -------------------------------------------------------------------
  114. * CUSTOM CONFIG VALUES
  115. * -------------------------------------------------------------------
  116. *
  117. * The $assign_to_config array below will be passed dynamically to the
  118. * config class when initialized. This allows you to set custom config
  119. * items or override any default config values found in the config.php file.
  120. * This can be handy as it permits you to share one application between
  121. * multiple front controller files, with each file containing different
  122. * config values.
  123. *
  124. * Un-comment the $assign_to_config array below to use this feature
  125. *
  126. */
  127. // $assign_to_config['name_of_config_item'] = 'value of config item';
  128. // --------------------------------------------------------------------
  129. // END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
  130. // --------------------------------------------------------------------
  131. /*
  132. * ---------------------------------------------------------------
  133. * Resolve the system path for increased reliability
  134. * ---------------------------------------------------------------
  135. */
  136. // Set the current directory correctly for CLI requests
  137. if (defined('STDIN'))
  138. {
  139. chdir(dirname(__FILE__));
  140. }
  141. if (realpath($system_path) !== FALSE)
  142. {
  143. $system_path = realpath($system_path).'/';
  144. }
  145. // ensure there's a trailing slash
  146. $system_path = rtrim($system_path, '/').'/';
  147. // Is the system path correct?
  148. if ( ! is_dir($system_path))
  149. {
  150. exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
  151. }
  152. /*
  153. * -------------------------------------------------------------------
  154. * Now that we know the path, set the main path constants
  155. * -------------------------------------------------------------------
  156. */
  157. // The name of THIS file
  158. define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
  159. // The PHP file extension
  160. define('EXT', '.php');
  161. // Path to the system folder
  162. define('BASEPATH', str_replace("\\", "/", $system_path));
  163. // Path to the front controller (this file)
  164. define('FCPATH', str_replace(SELF, '', __FILE__));
  165. // Name of the "system folder"
  166. define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
  167. // The path to the "application" folder
  168. if (is_dir($application_folder))
  169. {
  170. define('APPPATH', $application_folder.'/');
  171. }
  172. else
  173. {
  174. if ( ! is_dir(BASEPATH.$application_folder.'/'))
  175. {
  176. exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
  177. }
  178. define('APPPATH', BASEPATH.$application_folder.'/');
  179. }
  180. define('SKINPATH', dirname(APPPATH). '/');
  181. /*
  182. * --------------------------------------------------------------------
  183. * LOAD THE BOOTSTRAP FILE
  184. * --------------------------------------------------------------------
  185. *
  186. * And away we go...
  187. *
  188. */
  189. require_once BASEPATH.'core/CodeIgniter'.EXT;
  190. /* End of file index.php */
  191. /* Location: ./index.php */