php $conf,$conf
$conf
应用的全局配置,格式为数组,一般通过配置文件包含返回。
非强制要求,开发较大型的项目时建议设置。
【定义】 文件:xiunophp/xiunophp.php 大约 63 行:
empty($conf) AND $conf = array("db"=>array(), "cache"=>array(), "tmp_path"=>"./", "log_path"=>"./", "timezone"=>"Asia/Shanghai");
【用例】
$conf = include "./conf.php";
include "./xiunophp/xiunophp.php";
?>
【conf.php】
return array (
// -------------> xiunophp 依赖的配置
"db"=>array(
"type"=>"pdo_mysql",
"pdo_mysql" => array (
"master" => array (
"host" => "localhost",
"user" => "root",
"password" => "root",
"name" => "test",
"charset" => "utf8",
"tablepre"=>"bbs_",
"engine"=>"myisam", // innodb
),
"slaves" => array()
)
),
"tmp_path" => "./", // 可以配置为 linux 下的 /dev/shm ,通过内存缓存临时文件
"log_path" => "./"
);
?>
php $conf,$conf相关推荐
- 【Redis】13.Redis服务器配置redis.conf
服务器端设定 设置服务器以守护进程的方式运行 deamonize yes|no 绑定主机地址 bind 127.0.0.1 设置服务器端口号 port 6379 设置数据库数量 databases 1 ...
- 找不到ld-linux.so.3,usr/bin/ld: cannot find 错误解决方法和 /etc/ld.so.conf
我makefile出现这个错误: HelloWorldServer.c:(.text+0xaa): undefined reference to `zmq_send' collect2: error: ...
- nginx错误:unknown directive “锘? in F:\nginx/conf/nginx.conf:3
用Nginx部署一个前端项目,用记事本修改了nginx\conf\nginx.conf 文件的相关配置并保存,居然启动时报错:unknown directive " " in D: ...
- system 相关的配置 /etc/sysctl.conf
sysctl root@B:/etc/sysctl.d# sysctl --h sysctl: unrecognized option: h BusyBox v1.28.3 () multi-call ...
- dns nsswitch.conf
#hosts: db files nisplus nis dns hosts: files dns 表示先找/etc/hosts 在招dns cat /etc/nsswitch.co ...
- 【u-boot-2018.11】make工具之conf
1. 概述 conf的源码位于scripts/kconfig目录下. 2. conf的编译 u-boot配置过程执行make pangu_basic_defconfig V=1,对应于顶层Makefi ...
- Redis 配置文件介绍——redis.conf
Units单位 # Note that in order to read the configuration file, Redis must be # started with the file p ...
- ldconfig动态链接库管理以及修改ld.so.conf.d
将"/usr/local/lib"加入配置文件重 执行命令: #echo "/usr/local/lib" >> /etc/ld.so.conf 然 ...
- Lua bind 和 conf 实现
Lua ,语法简单(极像javascript), 移植性好(纯C实现), 启动速度快,空间占用小, 真不愧是潜入式脚本语言之王. 本人想拿它来做 配置文件(conf),也想加一点IoC, 就是配置脚本 ...
- vrrp preempt mode configed in keepalived conf
在配置keepalived vrrp instance时, 有一个nopreempt的选项, 如果配置了nopreempt, 表示进入BACKUP状态的路由器不会在Master还活着的情况下, 抢占M ...
最新文章
- 基于Golang的对象序列化的程序包开发——myJsonMarshal
- 通用c/c++的Makefile模版
- Buffer Cache Hit Ratio
- 使用xshell 登陆aws的ec2
- 从javaagent迁移到JVMTI:我们的经验
- 【qduoj - 夏季学期创新题】最长公共子串(水题暴力枚举,不是LCS啊)
- OpenCV中图像轮廓检测
- linux中实现getch函数
- 【编码-纠错码】通信编码中的R-S编码方式
- Android流光动画,流光相机app_流光相机官网-多特软件站安卓网
- 小米9pro计算机打不开,小米9pro怎么连接电脑
- 记录一次opper R9s Plus 从发现循环重启到解决的过程
- 地下停车场的车内与车外,揭露了中年男人内心最沉重的痛
- 妥妥的世界第一:为什么MT4软件的地位无法撼动?
- 【机器学习】使用scikitLearn对数据进行聚类:Kmeans聚类算法及聚类效果评估
- Darknet官方文档(含Yolo-V2和V3在win和Linux训练测试步骤、计算mAP、调参优化等)
- (转)软件版本中的Alpha,Beta,RC,Trial是什么意思?
- Median (25)
- LeetCode 第 993 题:二叉树的堂兄弟结点
- Vue项目提高页面加载速度的方法