constants.php CI Explained

I’ve stopped work on this series to start a new one for CI 3.

This post is part of a series which explains CodeIgniter (CI) source code. This post explains CI 2.1.3 constants.php script. This script gets loaded by the CI bootstrap CodeIgniter.php.


You can have a different versions for each ENVIRONMENT. Each environment will load it’s own constants.php .


| File and Directory Modes
| These prefs are used when checking and setting modes when working
| with the file system.  The defaults are fine on servers with proper
| security, but you may wish (or even need) to change the values in
| certain environments (Apache running a separate process for each
| user, PHP under CGI with Apache suEXEC, etc.).  Octal values should
| always be used to set the mode correctly.
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0777);


| File Stream Modes
| These modes are used when working with fopen()/popen()

define('FOPEN_READ',							'rb');
define('FOPEN_READ_WRITE',						'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE',		'wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE',	'w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE',					'ab');
define('FOPEN_READ_WRITE_CREATE',				'a+b');
define('FOPEN_WRITE_CREATE_STRICT',				'xb');

/* End of file constants.php */
/* Location: ./application/config/constants.php */


About samehramzylabib

See About on
This entry was posted in CI Source Code Explained. Bookmark the permalink.

One Response to constants.php CI Explained

  1. Pingback: Bootstrap Source Code for CI Explained | Sam's PHP


Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s