PageRenderTime 46ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/pm/index.php

https://bitbucket.org/amitholkar/zenfile-18-05
PHP | 204 lines | 51 code | 27 blank | 126 comment | 9 complexity | e64b1a7118ba50f49aee8b0844191a52 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. break;
  36. case 'testing':
  37. case 'production':
  38. error_reporting(0);
  39. break;
  40. default:
  41. exit('The application environment is not set correctly.');
  42. }
  43. }
  44. /*
  45. *---------------------------------------------------------------
  46. * SYSTEM FOLDER NAME
  47. *---------------------------------------------------------------
  48. *
  49. * This variable must contain the name of your "system" folder.
  50. * Include the path if the folder is not in the same directory
  51. * as this file.
  52. *
  53. */
  54. $system_path = '../ci-2.1.0';
  55. /*
  56. *---------------------------------------------------------------
  57. * APPLICATION FOLDER NAME
  58. *---------------------------------------------------------------
  59. *
  60. * If you want this front controller to use a different "application"
  61. * folder then the default one you can set its name here. The folder
  62. * can also be renamed or relocated anywhere on your server. If
  63. * you do, use a full server path. For more info please see the user guide:
  64. * http://codeigniter.com/user_guide/general/managing_apps.html
  65. *
  66. * NO TRAILING SLASH!
  67. *
  68. */
  69. $application_folder = '../applications/pm';
  70. /*
  71. * --------------------------------------------------------------------
  72. * DEFAULT CONTROLLER
  73. * --------------------------------------------------------------------
  74. *
  75. * Normally you will set your default controller in the routes.php file.
  76. * You can, however, force a custom routing by hard-coding a
  77. * specific controller class/function here. For most applications, you
  78. * WILL NOT set your routing here, but it's an option for those
  79. * special instances where you might want to override the standard
  80. * routing in a specific front controller that shares a common CI installation.
  81. *
  82. * IMPORTANT: If you set the routing here, NO OTHER controller will be
  83. * callable. In essence, this preference limits your application to ONE
  84. * specific controller. Leave the function name blank if you need
  85. * to call functions dynamically via the URI.
  86. *
  87. * Un-comment the $routing array below to use this feature
  88. *
  89. */
  90. // The directory name, relative to the "controllers" folder. Leave blank
  91. // if your controller is not in a sub-folder within the "controllers" folder
  92. // $routing['directory'] = '';
  93. // The controller class file name. Example: Mycontroller
  94. // $routing['controller'] = '';
  95. // The controller function you wish to be called.
  96. // $routing['function'] = '';
  97. /*
  98. * -------------------------------------------------------------------
  99. * CUSTOM CONFIG VALUES
  100. * -------------------------------------------------------------------
  101. *
  102. * The $assign_to_config array below will be passed dynamically to the
  103. * config class when initialized. This allows you to set custom config
  104. * items or override any default config values found in the config.php file.
  105. * This can be handy as it permits you to share one application between
  106. * multiple front controller files, with each file containing different
  107. * config values.
  108. *
  109. * Un-comment the $assign_to_config array below to use this feature
  110. *
  111. */
  112. // $assign_to_config['name_of_config_item'] = 'value of config item';
  113. // --------------------------------------------------------------------
  114. // END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
  115. // --------------------------------------------------------------------
  116. /*
  117. * ---------------------------------------------------------------
  118. * Resolve the system path for increased reliability
  119. * ---------------------------------------------------------------
  120. */
  121. // Set the current directory correctly for CLI requests
  122. if (defined('STDIN'))
  123. {
  124. chdir(dirname(__FILE__));
  125. }
  126. if (realpath($system_path) !== FALSE)
  127. {
  128. $system_path = realpath($system_path).'/';
  129. }
  130. // ensure there's a trailing slash
  131. $system_path = rtrim($system_path, '/').'/';
  132. // Is the system path correct?
  133. if ( ! is_dir($system_path))
  134. {
  135. exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
  136. }
  137. /*
  138. * -------------------------------------------------------------------
  139. * Now that we know the path, set the main path constants
  140. * -------------------------------------------------------------------
  141. */
  142. // The name of THIS file
  143. define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
  144. // The PHP file extension
  145. // this global constant is deprecated.
  146. define('EXT', '.php');
  147. // Path to the system folder
  148. define('BASEPATH', str_replace("\\", "/", $system_path));
  149. // Path to the front controller (this file)
  150. define('FCPATH', str_replace(SELF, '', __FILE__));
  151. // Name of the "system folder"
  152. define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
  153. // The path to the "application" folder
  154. if (is_dir($application_folder))
  155. {
  156. define('APPPATH', $application_folder.'/');
  157. }
  158. else
  159. {
  160. if ( ! is_dir(BASEPATH.$application_folder.'/'))
  161. {
  162. exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
  163. }
  164. define('APPPATH', BASEPATH.$application_folder.'/');
  165. }
  166. define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
  167. /*
  168. * --------------------------------------------------------------------
  169. * LOAD THE BOOTSTRAP FILE
  170. * --------------------------------------------------------------------
  171. *
  172. * And away we go...
  173. *
  174. */
  175. require_once BASEPATH.'core/CodeIgniter.php';
  176. /* End of file index.php */
  177. /* Location: ./index.php */