blob: 01096c74ad2eaea0d0772b4578c10afd9c3173f8 [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*/
30
D. Marshall Lemcoe Jr.88dabf12012-09-03 01:46:30 -030031define('FOPEN_READ', 'rb');
32define('FOPEN_READ_WRITE', 'r+b');
33define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
34define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
35define('FOPEN_WRITE_CREATE', 'ab');
36define('FOPEN_READ_WRITE_CREATE', 'a+b');
37define('FOPEN_WRITE_CREATE_STRICT', 'xb');
38define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
Derek Allard2067d1a2008-11-13 22:59:24 +000039
Timothy Warren9a902cb2011-10-18 04:06:29 -040040/*
41|--------------------------------------------------------------------------
42| Display Debug backtrace
43|--------------------------------------------------------------------------
44|
Andrey Andreeve734b382012-03-26 13:42:36 +030045| If set to TRUE, a backtrace will be displayed along with php errors. If
46| error_reporting is disabled, the backtrace will not display, regardless
Timothy Warren9a902cb2011-10-18 04:06:29 -040047| of this setting
48|
49*/
Timothy Warren5160cc92011-10-18 06:50:06 -040050define('SHOW_DEBUG_BACKTRACE', TRUE);
Timothy Warren9a902cb2011-10-18 04:06:29 -040051
Daniel Hunsaker3b5b7f42013-02-22 19:17:56 -070052/*
53|--------------------------------------------------------------------------
54| Exit Status Codes
55|--------------------------------------------------------------------------
56|
57| Used to indicate the conditions under which the script is exit()ing.
58| While there is no universal standard for error codes, there are some
Daniel Hunsaker50dfe012013-03-04 02:05:20 -070059| broad conventions. Three such conventions are mentioned below, for
Andrey Andreev0760a442013-09-23 13:59:46 +030060| those who wish to make use of them. The CodeIgniter defaults were
Daniel Hunsaker3b5b7f42013-02-22 19:17:56 -070061| chosen for the least overlap with these conventions, while still
62| leaving room for others to be defined in future versions and user
Daniel Hunsaker50dfe012013-03-04 02:05:20 -070063| applications.
Andrey Andreev0760a442013-09-23 13:59:46 +030064|
Daniel Hunsaker50dfe012013-03-04 02:05:20 -070065| The three main conventions used for determining exit status codes
66| are as follows:
67|
68| Standard C/C++ Library (stdlibc):
69| http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
70| (This link also contains other GNU-specific conventions)
71| BSD sysexits.h:
72| http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
73| Bash scripting:
74| http://tldp.org/LDP/abs/html/exitcodes.html
Daniel Hunsaker3b5b7f42013-02-22 19:17:56 -070075|
76*/
Daniel Hunsaker3b5b7f42013-02-22 19:17:56 -070077define('EXIT_SUCCESS', 0); // no errors
Daniel Hunsaker50dfe012013-03-04 02:05:20 -070078define('EXIT_ERROR', 1); // generic error
Daniel Hunsaker3b5b7f42013-02-22 19:17:56 -070079define('EXIT_CONFIG', 3); // configuration error
Daniel Hunsaker50dfe012013-03-04 02:05:20 -070080define('EXIT_UNKNOWN_FILE', 4); // file not found
81define('EXIT_UNKNOWN_CLASS', 5); // unknown class
82define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
Daniel Hunsaker3b5b7f42013-02-22 19:17:56 -070083define('EXIT_USER_INPUT', 7); // invalid user input
84define('EXIT_DATABASE', 8); // database error
85define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
86define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code