您好,欢迎访问一九零五行业门户网

CI框架源码阅读,系统常量文件constants.php的配置

配置系统常量 
1、当文件系统工作的时候检查并配置这些首选项
文件系统运行的时候这些默认的值会适当的增加系统的安全性,但是在php或apache的底层单独的为每各用户开一个进程的时候,使用八进制的值永远是正确的
file_read_mode 读取文件的模式
file_write_mode   写入文件的模式
dir_read_mode   读取目录的模式
dir_write_mode 写入目录的模式
2、文件流模式
当我们使用fopen()/popen()的时候需要这些模式
define('fopen_read', 'rb');
define('fopen_read_write', 'r+b');
define('fopen_write_create_destructive', 'wb'); 
define('fopen_read_write_create_destructive',  'w+b'); 
define('fopen_write_create', 'ab');
define('fopen_read_write_create', 'a+b');
define('fopen_write_create_strict', 'xb');
define('fopen_read_write_create_strict',  'x+b');
文件源码:
复制代码 代码如下:
[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');  
define('fopen_read_write_create_strict',        'x+b');
/* end of file constants.php */  
/* location: ./application/config/constants.php */
其它类似信息

推荐信息