PageRenderTime 35ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/index.php

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