PageRenderTime 51ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/index.php

https://bitbucket.org/ah_01/p_survey_ci
PHP | 207 lines | 50 code | 29 blank | 128 comment | 7 complexity | ab56e1da8c66abd281bcdd5316274cc7 MD5 | raw file
  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', 'development');
  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. // var_dump($_SESSION['timeout'] = 100);
  36. // var_dump($_SERVER);
  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 = 'system';
  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 = 'application';
  72. /*
  73. * --------------------------------------------------------------------
  74. * DEFAULT CONTROLLER
  75. * --------------------------------------------------------------------
  76. *
  77. * Normally you will set your default controller in the routes.php file.
  78. * You can, however, force a custom routing by hard-coding a
  79. * specific controller class/function here. For most applications, you
  80. * WILL NOT set your routing here, but it's an option for those
  81. * special instances where you might want to override the standard
  82. * routing in a specific front controller that shares a common CI installation.
  83. *
  84. * IMPORTANT: If you set the routing here, NO OTHER controller will be
  85. * callable. In essence, this preference limits your application to ONE
  86. * specific controller. Leave the function name blank if you need
  87. * to call functions dynamically via the URI.
  88. *
  89. * Un-comment the $routing array below to use this feature
  90. *
  91. */
  92. // The directory name, relative to the "controllers" folder. Leave blank
  93. // if your controller is not in a sub-folder within the "controllers" folder
  94. // $routing['directory'] = '';
  95. // The controller class file name. Example: Mycontroller
  96. // $routing['controller'] = '';
  97. // The controller function you wish to be called.
  98. // $routing['function'] = '';
  99. /*
  100. * -------------------------------------------------------------------
  101. * CUSTOM CONFIG VALUES
  102. * -------------------------------------------------------------------
  103. *
  104. * The $assign_to_config array below will be passed dynamically to the
  105. * config class when initialized. This allows you to set custom config
  106. * items or override any default config values found in the config.php file.
  107. * This can be handy as it permits you to share one application between
  108. * multiple front controller files, with each file containing different
  109. * config values.
  110. *
  111. * Un-comment the $assign_to_config array below to use this feature
  112. *
  113. */
  114. // $assign_to_config['name_of_config_item'] = 'value of config item';
  115. // --------------------------------------------------------------------
  116. // END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
  117. // --------------------------------------------------------------------
  118. /*
  119. * ---------------------------------------------------------------
  120. * Resolve the system path for increased reliability
  121. * ---------------------------------------------------------------
  122. */
  123. // Set the current directory correctly for CLI requests
  124. if (defined('STDIN'))
  125. {
  126. chdir(dirname(__FILE__));
  127. }
  128. if (realpath($system_path) !== FALSE)
  129. {
  130. $system_path = realpath($system_path).'/';
  131. }
  132. // ensure there's a trailing slash
  133. $system_path = rtrim($system_path, '/').'/';
  134. // Is the system path correct?
  135. if ( ! is_dir($system_path))
  136. {
  137. exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
  138. }
  139. /*
  140. * -------------------------------------------------------------------
  141. * Now that we know the path, set the main path constants
  142. * -------------------------------------------------------------------
  143. */
  144. // The name of THIS file
  145. define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
  146. // The PHP file extension
  147. // this global constant is deprecated.
  148. define('EXT', '.php');
  149. // Path to the system folder
  150. define('BASEPATH', str_replace("\\", "/", $system_path));
  151. // Path to the front controller (this file)
  152. define('FCPATH', str_replace(SELF, '', __FILE__));
  153. // Name of the "system folder"
  154. define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
  155. // The path to the "application" folder
  156. if (is_dir($application_folder))
  157. {
  158. define('APPPATH', $application_folder.'/');
  159. }
  160. else
  161. {
  162. if ( ! is_dir(BASEPATH.$application_folder.'/'))
  163. {
  164. exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
  165. }
  166. define('APPPATH', BASEPATH.$application_folder.'/');
  167. }
  168. /*
  169. * --------------------------------------------------------------------
  170. * LOAD THE BOOTSTRAP FILE
  171. * --------------------------------------------------------------------
  172. *
  173. * And away we go...
  174. *
  175. */
  176. require_once BASEPATH.'core/CodeIgniter.php';
  177. /* End of file index.php */
  178. /* Location: ./index.php */