$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相关推荐

  1. 【Redis】13.Redis服务器配置redis.conf

    服务器端设定 设置服务器以守护进程的方式运行 deamonize yes|no 绑定主机地址 bind 127.0.0.1 设置服务器端口号 port 6379 设置数据库数量 databases 1 ...

  2. 找不到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: ...

  3. nginx错误:unknown directive “锘? in F:\nginx/conf/nginx.conf:3

    用Nginx部署一个前端项目,用记事本修改了nginx\conf\nginx.conf 文件的相关配置并保存,居然启动时报错:unknown directive " " in D: ...

  4. system 相关的配置 /etc/sysctl.conf

    sysctl root@B:/etc/sysctl.d# sysctl --h sysctl: unrecognized option: h BusyBox v1.28.3 () multi-call ...

  5. dns nsswitch.conf

    #hosts:     db files nisplus nis dns hosts:      files dns 表示先找/etc/hosts 在招dns cat /etc/nsswitch.co ...

  6. 【u-boot-2018.11】make工具之conf

    1. 概述 conf的源码位于scripts/kconfig目录下. 2. conf的编译 u-boot配置过程执行make pangu_basic_defconfig V=1,对应于顶层Makefi ...

  7. Redis 配置文件介绍——redis.conf

    Units单位 # Note that in order to read the configuration file, Redis must be # started with the file p ...

  8. ldconfig动态链接库管理以及修改ld.so.conf.d

    将"/usr/local/lib"加入配置文件重 执行命令: #echo "/usr/local/lib" >> /etc/ld.so.conf 然 ...

  9. Lua bind 和 conf 实现

    Lua ,语法简单(极像javascript), 移植性好(纯C实现), 启动速度快,空间占用小, 真不愧是潜入式脚本语言之王. 本人想拿它来做 配置文件(conf),也想加一点IoC, 就是配置脚本 ...

  10. vrrp preempt mode configed in keepalived conf

    在配置keepalived vrrp instance时, 有一个nopreempt的选项, 如果配置了nopreempt, 表示进入BACKUP状态的路由器不会在Master还活着的情况下, 抢占M ...

最新文章

  1. 基于Golang的对象序列化的程序包开发——myJsonMarshal
  2. 通用c/c++的Makefile模版
  3. Buffer Cache Hit Ratio
  4. 使用xshell 登陆aws的ec2
  5. 从javaagent迁移到JVMTI:我们的经验
  6. 【qduoj - 夏季学期创新题】最长公共子串(水题暴力枚举,不是LCS啊)
  7. OpenCV中图像轮廓检测
  8. linux中实现getch函数
  9. 【编码-纠错码】通信编码中的R-S编码方式
  10. Android流光动画,流光相机app_流光相机官网-多特软件站安卓网
  11. 小米9pro计算机打不开,小米9pro怎么连接电脑
  12. 记录一次opper R9s Plus 从发现循环重启到解决的过程
  13. 地下停车场的车内与车外,揭露了中年男人内心最沉重的痛
  14. 妥妥的世界第一:为什么MT4软件的地位无法撼动?
  15. 【机器学习】使用scikitLearn对数据进行聚类:Kmeans聚类算法及聚类效果评估
  16. Darknet官方文档(含Yolo-V2和V3在win和Linux训练测试步骤、计算mAP、调参优化等)
  17. (转)软件版本中的Alpha,Beta,RC,Trial是什么意思?
  18. Median (25)
  19. LeetCode 第 993 题:二叉树的堂兄弟结点
  20. Vue项目提高页面加载速度的方法

热门文章

  1. 技巧打开网页进行客户个性化信息提交(代码编写)
  2. 控件onkeyup事件,使验证控件不能即时验证
  3. 【组原】广州大学计算机组成原理考试部分题+复习资料(2020-2021)
  4. gorm一对一 一对多 多对多查询案例
  5. Linux find查找文件夹(目录)所在位置
  6. Ubuntu18.04安装Scala
  7. Alpine Linux 中的 apk 命令讲解
  8. 【收藏】win10利用WSL2安装docker的2种方式
  9. linux 产生50-100之内的随机数
  10. docker安装Jenkins:查看安装版本信息