blob: 48283e223f72869d51283278e4e82517cfba58cf [file] [log] [blame]
darwineld8bef8a2014-02-11 20:13:22 +01001<?php
darwineld8bef8a2014-02-11 20:13:22 +01002defined('BASEPATH') OR exit('No direct script access allowed');
Derek Allard2067d1a2008-11-13 22:59:24 +00003
4/*
5|--------------------------------------------------------------------------
6| File and Directory Modes
7|--------------------------------------------------------------------------
8|
9| These prefs are used when checking and setting modes when working
Derek Jones37f4b9c2011-07-01 17:56:50 -050010| with the file system. The defaults are fine on servers with proper
Derek Allard2067d1a2008-11-13 22:59:24 +000011| security, but you may wish (or even need) to change the values in
12| certain environments (Apache running a separate process for each
Derek Jones37f4b9c2011-07-01 17:56:50 -050013| user, PHP under CGI with Apache suEXEC, etc.). Octal values should
Derek Allard2067d1a2008-11-13 22:59:24 +000014| always be used to set the mode correctly.
15|
16*/
17define('FILE_READ_MODE', 0644);
18define('FILE_WRITE_MODE', 0666);
19define('DIR_READ_MODE', 0755);
Andrey Andreev45965742014-08-27 20:40:11 +030020define('DIR_WRITE_MODE', 0755);
Derek Allard2067d1a2008-11-13 22:59:24 +000021
22/*
23|--------------------------------------------------------------------------
24| File Stream Modes
25|--------------------------------------------------------------------------
26|
27| These modes are used when working with fopen()/popen()
28|
29*/
D. Marshall Lemcoe Jr.88dabf12012-09-03 01:46:30 -030030define('FOPEN_READ', 'rb');
31define('FOPEN_READ_WRITE', 'r+b');
32define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
33define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
34define('FOPEN_WRITE_CREATE', 'ab');
35define('FOPEN_READ_WRITE_CREATE', 'a+b');
36define('FOPEN_WRITE_CREATE_STRICT', 'xb');
37define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
Derek Allard2067d1a2008-11-13 22:59:24 +000038
Timothy Warren9a902cb2011-10-18 04:06:29 -040039/*
40|--------------------------------------------------------------------------
41| Display Debug backtrace
42|--------------------------------------------------------------------------
43|
Andrey Andreeve734b382012-03-26 13:42:36 +030044| If set to TRUE, a backtrace will be displayed along with php errors. If
45| error_reporting is disabled, the backtrace will not display, regardless
Timothy Warren9a902cb2011-10-18 04:06:29 -040046| of this setting
47|
48*/
Timothy Warren5160cc92011-10-18 06:50:06 -040049define('SHOW_DEBUG_BACKTRACE', TRUE);
Timothy Warren9a902cb2011-10-18 04:06:29 -040050
Daniel Hunsaker3b5b7f42013-02-22 19:17:56 -070051/*
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 Hunsaker50dfe012013-03-04 02:05:20 -070058| broad conventions. Three such conventions are mentioned below, for
Andrey Andreev0760a442013-09-23 13:59:46 +030059| those who wish to make use of them. The CodeIgniter defaults were
Daniel Hunsaker3b5b7f42013-02-22 19:17:56 -070060| chosen for the least overlap with these conventions, while still
61| leaving room for others to be defined in future versions and user
Daniel Hunsaker50dfe012013-03-04 02:05:20 -070062| applications.
Andrey Andreev0760a442013-09-23 13:59:46 +030063|
Daniel Hunsaker50dfe012013-03-04 02:05:20 -070064| 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 Hunsaker3b5b7f42013-02-22 19:17:56 -070074|
75*/
Daniel Hunsaker3b5b7f42013-02-22 19:17:56 -070076define('EXIT_SUCCESS', 0); // no errors
Daniel Hunsaker50dfe012013-03-04 02:05:20 -070077define('EXIT_ERROR', 1); // generic error
Daniel Hunsaker3b5b7f42013-02-22 19:17:56 -070078define('EXIT_CONFIG', 3); // configuration error
Daniel Hunsaker50dfe012013-03-04 02:05:20 -070079define('EXIT_UNKNOWN_FILE', 4); // file not found
80define('EXIT_UNKNOWN_CLASS', 5); // unknown class
81define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
Daniel Hunsaker3b5b7f42013-02-22 19:17:56 -070082define('EXIT_USER_INPUT', 7); // invalid user input
83define('EXIT_DATABASE', 8); // database error
84define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
85define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code