Commit 1fdcf15d authored by wanjilong's avatar wanjilong

add: 修改daemon

parent 2a336f9e
...@@ -56,7 +56,7 @@ php api.go2yd.com/htdocs/Website/public/cli.php $2 $3 ...@@ -56,7 +56,7 @@ php api.go2yd.com/htdocs/Website/public/cli.php $2 $3
while true; do while true; do
is_master_on=$(pgrep -fc "$2") is_master_on=$(pgrep -fc "$2 $1 master process")
if [[ ${is_master_on} -gt 0 ]]; then if [[ ${is_master_on} -gt 0 ]]; then
if [[ ! -f "$start_done_file" ]]; then if [[ ! -f "$start_done_file" ]]; then
touch ${start_done_file} touch ${start_done_file}
......
...@@ -7,8 +7,8 @@ ini_set("error_reporting",E_ALL);//显示所有错误 ...@@ -7,8 +7,8 @@ ini_set("error_reporting",E_ALL);//显示所有错误
* cli bootstrap:application/BootstrapCli.php ( 在cli.ini中配置 * cli bootstrap:application/BootstrapCli.php ( 在cli.ini中配置
* 默认模块:modules/cli * 默认模块:modules/cli
* 脚本位置:modules/cli/controllers/xxx.php * 脚本位置:modules/cli/controllers/xxx.php
* 调用方式:php cli.php controller action "a=1&b=2" * 调用方式:php cli.php Wallet 2 sync_wallet
* 测试脚本:php cli.php test index "a=1&b=2" *
*/ */
if( !substr(php_sapi_name(), 0, 3) == 'cli' ) { if( !substr(php_sapi_name(), 0, 3) == 'cli' ) {
die; die;
...@@ -25,7 +25,7 @@ $application = new Yaf\Application( ROOT_PATH . "/conf/cli.ini"); ...@@ -25,7 +25,7 @@ $application = new Yaf\Application( ROOT_PATH . "/conf/cli.ini");
/** /**
* 获取模块/控制器/方法 * 获取模块/控制器/方法
usage: php cli.php "t=Wallet&n=2&j=sync_wallet" usage: php cli.php "t=Wallet&n=2&j=sync_wallet"
usage: php cli.php Wallet sync_wallet 2 usage: php cli.php Wallet 2 sync_wallet
* *
*/ */
$module = "cli"; $module = "cli";
...@@ -35,15 +35,8 @@ $method = "run"; ...@@ -35,15 +35,8 @@ $method = "run";
$param = []; $param = [];
$param['t'] = $argv[1] ?? "Wallet"; $param['t'] = $argv[1] ?? "Wallet";
$param['n'] = $argv[2] ?? 2; $param['n'] = $argv[2] ?? 2;
$param['j'] = $argv[3] ?? "sync_wallet";
$_SERVER['SERVER_NAME'] = 'daemon.pay'; $_SERVER['SERVER_NAME'] = 'daemon.pay';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1'; $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
/*
if (!empty($argv[3]))
{
parse_str($argv[3], $param);
}
*/
$application->bootstrap()->getDispatcher()->dispatch( new Yaf\Request\Simple("", $module, $controller,$method,$param) ); $application->bootstrap()->getDispatcher()->dispatch( new Yaf\Request\Simple("", $module, $controller,$method,$param) );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment