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

高洛峰
发布: 2016-12-01 14:59:59
原创
1570人浏览过

配置系统常量 
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]  
<?php  if ( ! defined('basepath')) 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 
| 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 */  

小绿鲸英文文献阅读器
小绿鲸英文文献阅读器

英文文献阅读器,专注提高SCI阅读效率

小绿鲸英文文献阅读器 199
查看详情 小绿鲸英文文献阅读器
相关标签:
php
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号