Why do you use YAML?
Because Yaml is simple and friendly to human beings;
yaml:http://www.yaml.org/
Where is it going to be used?
The most basic, in the thinkphp configuration file can choose the Yaml format, you are willing to write Yaml simple format configuration? Or are you willing to write long, smelly and difficult to write PHP array?
Http://document.thinkphp.cn/manual_3_2.html
Here's the problem.
So I changed the configuration format to Yaml:
Copy Code code as follows:
/index.php
The format of the definition configuration file is Yaml
Define (' Conf_ext ', '. Yaml ');
Then change the config.php in the application directory to Config.yaml.
This time, the error:
Copy Code code as follows:
Class ' SPYC ' not found error position file:d:\app\think\thinkphp\common\functions.php line:90
Then find, find this paragraph:
Copy Code code as follows:
/**
* Parse Yaml file returns an array
* @param string $file profile Name
* @return Array
*/
if (!function_exists (' Yaml_parse_file ')) {
function Yaml_parse_file ($file) {
Vendor (' Spyc. Spyc ');
Return Spyc::yamlload ($file);
}
}
Seemingly introduced SPYC This library was not found.
Looking for a moment, Spyc here: https://github.com/mustangostang/spyc/
Then, what is this vendor?
Look here: http://document.thinkphp.cn/manual_3_2.html
Conclusion:
In the above Git download spyc.php put into the/thinkphp/library/vendor/spyc/directory, everything is normal! Done with the right way!