darwinel | d8bef8a | 2014-02-11 20:13:22 +0100 | [diff] [blame] | 1 | <?php |
darwinel | d8bef8a | 2014-02-11 20:13:22 +0100 | [diff] [blame] | 2 | defined('BASEPATH') OR exit('No direct script access allowed'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 3 | |
| 4 | /* |
| 5 | |-------------------------------------------------------------------------- |
Andrey Andreev | 0d60a21 | 2015-08-13 13:14:59 +0300 | [diff] [blame] | 6 | | Display Debug backtrace |
| 7 | |-------------------------------------------------------------------------- |
| 8 | | |
| 9 | | If set to TRUE, a backtrace will be displayed along with php errors. If |
| 10 | | error_reporting is disabled, the backtrace will not display, regardless |
| 11 | | of this setting |
| 12 | | |
| 13 | */ |
| 14 | defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE); |
| 15 | |
| 16 | /* |
| 17 | |-------------------------------------------------------------------------- |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 18 | | File and Directory Modes |
| 19 | |-------------------------------------------------------------------------- |
| 20 | | |
| 21 | | These prefs are used when checking and setting modes when working |
Derek Jones | 37f4b9c | 2011-07-01 17:56:50 -0500 | [diff] [blame] | 22 | | with the file system. The defaults are fine on servers with proper |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 23 | | security, but you may wish (or even need) to change the values in |
| 24 | | certain environments (Apache running a separate process for each |
Derek Jones | 37f4b9c | 2011-07-01 17:56:50 -0500 | [diff] [blame] | 25 | | user, PHP under CGI with Apache suEXEC, etc.). Octal values should |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 26 | | always be used to set the mode correctly. |
| 27 | | |
| 28 | */ |
Andrey Andreev | 0d60a21 | 2015-08-13 13:14:59 +0300 | [diff] [blame] | 29 | defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644); |
| 30 | defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666); |
| 31 | defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755); |
| 32 | defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 33 | |
| 34 | /* |
| 35 | |-------------------------------------------------------------------------- |
| 36 | | File Stream Modes |
| 37 | |-------------------------------------------------------------------------- |
| 38 | | |
| 39 | | These modes are used when working with fopen()/popen() |
| 40 | | |
| 41 | */ |
Andrey Andreev | 0d60a21 | 2015-08-13 13:14:59 +0300 | [diff] [blame] | 42 | defined('FOPEN_READ') OR define('FOPEN_READ', 'rb'); |
| 43 | defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b'); |
| 44 | defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care |
Andrey Andreev | 05268d6 | 2016-01-13 15:59:42 +0200 | [diff] [blame] | 45 | defined('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care |
Andrey Andreev | 0d60a21 | 2015-08-13 13:14:59 +0300 | [diff] [blame] | 46 | defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab'); |
| 47 | defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b'); |
| 48 | defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb'); |
| 49 | defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b'); |
Timothy Warren | 9a902cb | 2011-10-18 04:06:29 -0400 | [diff] [blame] | 50 | |
Daniel Hunsaker | 3b5b7f4 | 2013-02-22 19:17:56 -0700 | [diff] [blame] | 51 | /* |
| 52 | |-------------------------------------------------------------------------- |
| 53 | | Exit Status Codes |
| 54 | |-------------------------------------------------------------------------- |
| 55 | | |
| 56 | | Used to indicate the conditions under which the script is exit()ing. |
| 57 | | While there is no universal standard for error codes, there are some |
Daniel Hunsaker | 50dfe01 | 2013-03-04 02:05:20 -0700 | [diff] [blame] | 58 | | broad conventions. Three such conventions are mentioned below, for |
Andrey Andreev | 0760a44 | 2013-09-23 13:59:46 +0300 | [diff] [blame] | 59 | | those who wish to make use of them. The CodeIgniter defaults were |
Daniel Hunsaker | 3b5b7f4 | 2013-02-22 19:17:56 -0700 | [diff] [blame] | 60 | | chosen for the least overlap with these conventions, while still |
| 61 | | leaving room for others to be defined in future versions and user |
Daniel Hunsaker | 50dfe01 | 2013-03-04 02:05:20 -0700 | [diff] [blame] | 62 | | applications. |
Andrey Andreev | 0760a44 | 2013-09-23 13:59:46 +0300 | [diff] [blame] | 63 | | |
Daniel Hunsaker | 50dfe01 | 2013-03-04 02:05:20 -0700 | [diff] [blame] | 64 | | The three main conventions used for determining exit status codes |
| 65 | | are as follows: |
| 66 | | |
| 67 | | Standard C/C++ Library (stdlibc): |
| 68 | | http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html |
| 69 | | (This link also contains other GNU-specific conventions) |
| 70 | | BSD sysexits.h: |
| 71 | | http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits |
| 72 | | Bash scripting: |
| 73 | | http://tldp.org/LDP/abs/html/exitcodes.html |
Daniel Hunsaker | 3b5b7f4 | 2013-02-22 19:17:56 -0700 | [diff] [blame] | 74 | | |
| 75 | */ |
Andrey Andreev | 0d60a21 | 2015-08-13 13:14:59 +0300 | [diff] [blame] | 76 | defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors |
| 77 | defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error |
| 78 | defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error |
| 79 | defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found |
| 80 | defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class |
| 81 | defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member |
| 82 | defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input |
| 83 | defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error |
| 84 | defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code |
| 85 | defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code |