贴出部分配置部分:只要在第一行加上
#!/usr/bin/env php
就可以了,当然,服务器上必须安装PHP咯。
#!/usr/bin/env php <?php $dbDefault=‘127.0.0.1€3306€datebase€username€password‘; $db=[ ‘DEVELOPMENT‘=>$dbDefault, ‘SERVER-TEST‘=>$dbDefault, ‘CLIENT-TEST‘=>$dbDefault, ‘GAMMA‘=>$dbDefault, ‘PRE-RELEASE‘=>‘‘, ‘RELEASE‘=>‘‘, ]; list($host,$port,$database,$user,$pass)=explode(‘€‘,$db[OPPO_ENV]); ?> source s_name { type = mysql sql_host = <?=$host;?> #这里要有字符,至少一个空格,其他也一样 sql_user = <?=$user;?> # sql_pass = <?=$pass;?> # sql_db = <?=$database;?> # sql_port = <?=$port;?> # optional, default is 3306
还有另外一种形式加载多个配置文件的方式:
#!/usr/bin/env php <?php include(dirname(__FILE__) . "/conf.d/source_s_book");?> # <?php include(dirname(__FILE__) . "/conf.d/source_s_book_delta");?> # <?php include(dirname(__FILE__) . "/conf.d/index_s_book");?> # <?php include(dirname(__FILE__) . "/conf.d/index_s_book_delta");?> # <?php include(dirname(__FILE__) . "/conf.d/indexer_s_book");?> # <?php include(dirname(__FILE__) . "/conf.d/searchd_s_book");?> #
后面注意每行php后面必须要有一个字符,空格或者#都行.
原文地址:http://my.oschina.net/SimonXH/blog/344729