/index.php

https://bitbucket.org/haloweb/halogy-1.0/ · PHP · 135 lines · 32 code · 14 blank · 89 comment · 5 complexity · 18b674570f076c1d31f677570220682a MD5 · raw file

  1. <?php
  2. /**
  3. * Halogy
  4. *
  5. * A user friendly, modular content management system for PHP 5.0
  6. * Built on CodeIgniter - http://codeigniter.com
  7. *
  8. * @package Halogy
  9. * @author Haloweb Ltd.
  10. * @copyright Copyright (c) 2008-2011, Haloweb Ltd.
  11. * @license http://halogy.com/license
  12. * @link http://halogy.com/
  13. * @since Version 1.0
  14. * @filesource
  15. */
  16. // ------------------------------------------------------------------------
  17. /*
  18. |---------------------------------------------------------------
  19. | PHP ERROR REPORTING LEVEL
  20. |---------------------------------------------------------------
  21. |
  22. | By default CI runs with error reporting set to ALL. For security
  23. | reasons you are encouraged to change this when your site goes live.
  24. | For more info visit: http://www.php.net/error_reporting
  25. |
  26. */
  27. error_reporting(E_ALL);
  28. /*
  29. |---------------------------------------------------------------
  30. | SYSTEM FOLDER NAME
  31. |---------------------------------------------------------------
  32. |
  33. | This variable must contain the name of your "system" folder.
  34. | Include the path if the folder is not in the same directory
  35. | as this file.
  36. |
  37. | NO TRAILING SLASH!
  38. |
  39. */
  40. $system_folder = "halogy";
  41. /*
  42. |---------------------------------------------------------------
  43. | APPLICATION FOLDER NAME
  44. |---------------------------------------------------------------
  45. |
  46. | If you want this front controller to use a different "application"
  47. | folder then the default one you can set its name here. The folder
  48. | can also be renamed or relocated anywhere on your server.
  49. | For more info please see the user guide:
  50. | http://codeigniter.com/user_guide/general/managing_apps.html
  51. |
  52. |
  53. | NO TRAILING SLASH!
  54. |
  55. */
  56. $application_folder = "application";
  57. /*
  58. |===============================================================
  59. | END OF USER CONFIGURABLE SETTINGS
  60. |===============================================================
  61. */
  62. /*
  63. |---------------------------------------------------------------
  64. | SET THE SERVER PATH
  65. |---------------------------------------------------------------
  66. |
  67. | Let's attempt to determine the full-server path to the "system"
  68. | folder in order to reduce the possibility of path problems.
  69. | Note: We only attempt this if the user hasn't specified a
  70. | full server path.
  71. |
  72. */
  73. if (strpos($system_folder, '/') === FALSE)
  74. {
  75. if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
  76. {
  77. $system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
  78. }
  79. }
  80. else
  81. {
  82. // Swap directory separators to Unix style for consistency
  83. $system_folder = str_replace("\\", "/", $system_folder);
  84. }
  85. /*
  86. |---------------------------------------------------------------
  87. | DEFINE APPLICATION CONSTANTS
  88. |---------------------------------------------------------------
  89. |
  90. | EXT - The file extension. Typically ".php"
  91. | FCPATH - The full server path to THIS file
  92. | SELF - The name of THIS file (typically "index.php)
  93. | BASEPATH - The full server path to the "system" folder
  94. | APPPATH - The full server path to the "application" folder
  95. |
  96. */
  97. define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
  98. define('FCPATH', __FILE__);
  99. define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
  100. define('BASEPATH', $system_folder.'/');
  101. if (is_dir($application_folder))
  102. {
  103. define('APPPATH', $application_folder.'/');
  104. }
  105. else
  106. {
  107. if ($application_folder == '')
  108. {
  109. $application_folder = 'application';
  110. }
  111. define('APPPATH', BASEPATH.$application_folder.'/');
  112. }
  113. /*
  114. |---------------------------------------------------------------
  115. | LOAD THE FRONT CONTROLLER
  116. |---------------------------------------------------------------
  117. |
  118. | And away we go...
  119. |
  120. */
  121. require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;