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

/installer/config/constants.php

https://github.com/asalem/pyrocms
PHP | 163 lines | 41 code | 15 blank | 107 comment | 8 complexity | 14eb48f674ba6172f6ed709a35098721 MD5 | raw file
Possible License(s): CC-BY-3.0, BSD-3-Clause, CC0-1.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, MIT
  1. <?php defined('BASEPATH') OR exit('No direct script access allowed');
  2. /**
  3. * CodeIgniter
  4. *
  5. * An open source application development framework for PHP 5.2.4 or newer
  6. *
  7. * NOTICE OF LICENSE
  8. *
  9. * Licensed under the Academic Free License version 3.0
  10. *
  11. * This source file is subject to the Academic Free License (AFL 3.0) that is
  12. * bundled with this package in the files license_afl.txt / license_afl.rst.
  13. * It is also available through the world wide web at this URL:
  14. * http://opensource.org/licenses/AFL-3.0
  15. * If you did not receive a copy of the license and are unable to obtain it
  16. * through the world wide web, please send an email to
  17. * licensing@ellislab.com so we can send you a copy immediately.
  18. *
  19. * @package CodeIgniter
  20. * @author EllisLab Dev Team
  21. * @copyright Copyright (c) 2008 - 2013, EllisLab, Inc. (http://ellislab.com/)
  22. * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0)
  23. * @link http://codeigniter.com
  24. * @since Version 1.0
  25. * @filesource
  26. */
  27. /*
  28. |--------------------------------------------------------------------------
  29. | File and Directory Modes
  30. |--------------------------------------------------------------------------
  31. |
  32. | These prefs are used when checking and setting modes when working
  33. | with the file system. The defaults are fine on servers with proper
  34. | security, but you may wish (or even need) to change the values in
  35. | certain environments (Apache running a separate process for each
  36. | user, PHP under CGI with Apache suEXEC, etc.). Octal values should
  37. | always be used to set the mode correctly.
  38. |
  39. */
  40. define('FILE_READ_MODE', 0644);
  41. define('FILE_WRITE_MODE', 0666);
  42. define('DIR_READ_MODE', 0755);
  43. define('DIR_WRITE_MODE', 0777);
  44. /*
  45. |--------------------------------------------------------------------------
  46. | File Stream Modes
  47. |--------------------------------------------------------------------------
  48. |
  49. | These modes are used when working with fopen()/popen()
  50. |
  51. */
  52. define('FOPEN_READ', 'rb');
  53. define('FOPEN_READ_WRITE', 'r+b');
  54. define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
  55. define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
  56. define('FOPEN_WRITE_CREATE', 'ab');
  57. define('FOPEN_READ_WRITE_CREATE', 'a+b');
  58. define('FOPEN_WRITE_CREATE_STRICT', 'xb');
  59. define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
  60. /*
  61. |--------------------------------------------------------------------------
  62. | Display Debug backtrace
  63. |--------------------------------------------------------------------------
  64. |
  65. | If set to TRUE, a backtrace will be displayed along with php errors. If
  66. | error_reporting is disabled, the backtrace will not display, regardless
  67. | of this setting
  68. |
  69. */
  70. define('SHOW_DEBUG_BACKTRACE', TRUE);
  71. /*
  72. |--------------------------------------------------------------------------
  73. | Exit Status Codes
  74. |--------------------------------------------------------------------------
  75. |
  76. | Used to indicate the conditions under which the script is exit()ing.
  77. | While there is no universal standard for error codes, there are some
  78. | broad conventions. Three such conventions are mentioned below, for
  79. | those who wish to make use of them. The CodeIgniter defaults were
  80. | chosen for the least overlap with these conventions, while still
  81. | leaving room for others to be defined in future versions and user
  82. | applications.
  83. |
  84. | The three main conventions used for determining exit status codes
  85. | are as follows:
  86. |
  87. | Standard C/C++ Library (stdlibc):
  88. | http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
  89. | (This link also contains other GNU-specific conventions)
  90. | BSD sysexits.h:
  91. | http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
  92. | Bash scripting:
  93. | http://tldp.org/LDP/abs/html/exitcodes.html
  94. |
  95. */
  96. define('EXIT_SUCCESS', 0); // no errors
  97. define('EXIT_ERROR', 1); // generic error
  98. define('EXIT_CONFIG', 3); // configuration error
  99. define('EXIT_UNKNOWN_FILE', 4); // file not found
  100. define('EXIT_UNKNOWN_CLASS', 5); // unknown class
  101. define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
  102. define('EXIT_USER_INPUT', 7); // invalid user input
  103. define('EXIT_DATABASE', 8); // database error
  104. define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
  105. define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
  106. /*
  107. |--------------------------------------------------------------------------
  108. | Environment
  109. |--------------------------------------------------------------------------
  110. */
  111. # Deprecated: This feature was rolled into CodeIgniter so we don't need to handle it ourselves anymore.
  112. define('ENV', ENVIRONMENT);
  113. /*
  114. |--------------------------------------------------------------------------
  115. | Docment root folders
  116. |--------------------------------------------------------------------------
  117. |
  118. | These constants use existing location information to work out web root, etc.
  119. |
  120. */
  121. // Base URL (keeps this crazy sh*t out of the config.php
  122. if (isset($_SERVER['HTTP_HOST'])) {
  123. $base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ? 'https' : 'http';
  124. $base_url .= '://'. $_SERVER['HTTP_HOST'];
  125. $base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);
  126. // Base URI (It's different to base URL!)
  127. $base_uri = parse_url($base_url, PHP_URL_PATH);
  128. if (substr($base_uri, 0, 1) != '/') $base_uri = '/'.$base_uri;
  129. if (substr($base_uri, -1, 1) != '/') $base_uri .= '/';
  130. } else {
  131. $base_url = 'http://localhost/';
  132. $base_uri = '/';
  133. }
  134. // Define these values to be used later on
  135. define('BASE_URL', $base_url);
  136. define('BASE_URI', $base_uri);
  137. define('APPPATH_URI', BASE_URI.APPPATH);
  138. // We dont need these variables any more
  139. unset($base_uri, $base_url);
  140. /*
  141. |--------------------------------------------------------------------------
  142. | PyroCMS Version
  143. |--------------------------------------------------------------------------
  144. |
  145. | Which version of PyroCMS is currently running?
  146. |
  147. */
  148. define('CMS_VERSION', '2.3.0-dev');