【发布时间】:2011-03-29 15:42:36
【问题描述】:
我参与了每个 php 项目(大约 25 个!),一些 sh 脚本可以帮助我完成日常任务,例如部署、repo 同步、数据库导出/导出等。
我管理的所有项目的sh脚本都是一样的,所以必须有一个配置文件来存储依赖于项目的不同参数:
# example conf, the sintaxys only needs to be able to have comments and be easy to edit.
host=www.host.com
administrator_email=guill@company.com
password=xxx
我只需要找到一种可以从 sh 脚本中读取(解析)此配置文件的干净方法,同时能够从我的 PHP 脚本中读取相同的参数。无需使用 XML。
你知道一个好的解决方案吗?
吉列尔莫
【问题讨论】:
标签: php linux bash configuration scripting