THINKPHP支持YAML配置文件的设置方法


为什么要用 yaml

因为 Yaml 简单,而且对人类友好;

Yaml: http://www.yaml.org/

在哪里会用到?

最基本的,在 ThinkPHP 的配置文件里面就可以选择 Yaml 的格式,你是愿意写 Yaml 的简洁格式配置呢?还是愿意写又长又臭又难写的 PHP array 呢?

http://document.thinkphp.cn/manual_3_2.html#config_format

问题来了

于是,我把配置格式改为 Yaml:

https://github.com/mustangostang/spyc/

然后,这个 vendor 是什么东东?

看这里:http://document.thinkphp.cn/manual_3_2.html#autoload

结论:

在上面的 Git 里面下载 Spyc.php 放进 /ThinkPHP/Library/Vendor/spyc/ 目录下,就一切正常!Done with the right way!


« 
» 

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3