首頁  >  文章  >  後端開發  >  CI框架原始碼閱讀,系統常數檔constants.php的配置

CI框架原始碼閱讀,系統常數檔constants.php的配置

高洛峰
高洛峰原創
2016-12-01 14:59:591267瀏覽

設定係統常數 
1、當檔案系統工作的時候檢查並配置這些首選項
檔案系統運作的時候這些預設的值會適當的增加系統的安全性,但是在php或apache的底層單獨的為每各當使用者開啟一個行程的時候,使用八進位的值永遠是正確的
FILE_READ_MODE 讀取檔案的模式
FILE_WRITE_MODE   寫入檔案的模式
DIR_READ_MODE  模式
當我們使用fopen()/popen()的時候需要這些模式
define('FOPEN_READ', 'rb');
define('FOPEN_READ_WRITE', 'r+b');
define('FOPEN_WRITEITE_ATE_DESTRU 'wb'); 
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE',  'w+b'); 
define('FOPEN_WRITE_CREATE', 'ab');
define('FOli_REEN_RED_RES_REDS_LIDS_UUS; ', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT',  'x+b');

檔案原始碼:
複製程式碼 程式碼如下:
[php]  
?? exit('No direct script access allowed');  

/* 
|--------------------------------- ----------------------------------------- 
| 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 .).  Octal values should 
| always be used to set the mode correctly. 

*/  
define('FILE_READ_MODE', 0644); 
define('FILE_READ_MODE', 0644); 
define('FILE_READ_MODE', 0644); 
define('FILE_READ_MODE', 0644); DIR_READ_MODE', 0755) ;  
define('DIR_WRITE_MODE', 0777);  

/* 
|--------------------------------- ------------------------------------------ 
| File Stream Modes 檔案流模式 
|------------------------------------------------- ------------------------- 

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

*/  

define( 'FOPEN_READ',                                    'r+b');  
define('FOPEN_WRITE_CREATE_DESTRUCTIVE',        'wb'); // truncates existing 膜',   'w+b'); // truncates existing file data, use with care  
define('FOPEN_WRITE_CREATE',          ,               'a+b');  
define('FOPEN_WRITE_CREATE_STRICT ',             'xb');  
define('FOPEN_READ_WRITE_CREATE_STRICT',        'x+b'); /* 位置: ./application/config/constants.php */

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn