不确定我是否理解在这样带有正斜杠和反斜杠的单行中编写 .json 配置的意义?
{"name":"zendframework/zendservice-twitter","description":"OOP wrapper for the Twitter web service","type":"library","keywords":["zf2","twitter"],"homepage":"http://packages.zendframework.com/","license":"BSD-3-Clause","autoload":{"psr-0":{"ZendService":"library/"}},"repositories":[{"type":"composer","url":"http://packages.zendframework.com/"}],"require":{"php":">=5.3.3","zendframework/zend-http":">=2.0.0","zendframework/zend-uri":">=2.0.0","zendframework/zend-version":">=2.0.0"},"extra":{"branch-alias":{"dev-master":"2.0.x-dev"}},"version":"2.0.1","dist":{"url":"http://packages.zendframework.com/composer/ZendService_Twitter-2.0.1.zip","type":"zip"}}
反
斜杠是一个转义字符,所以每次你看到
/
,/
都会被转义。
整个对象写在一行上的事实很可能是生成 JSON 的任何内容的工件(我假设它不是手写的)。