diff options
author | Friendika <info@friendika.com> | 2011-08-18 04:26:16 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-08-18 04:26:16 -0700 |
commit | 0808e4c930de84d0a68fe8fc4b7683110b6b6fed (patch) | |
tree | ce72602c9627c4553b3c0365ad438bf924e23bc4 /addon/poormancron/poormancron.php | |
parent | c534dd2969484625adda9cc82ad9d92664a96789 (diff) | |
parent | 35e65f18bd5fe99f1f11dde0196a4218cff96e29 (diff) | |
download | volse-hubzilla-0808e4c930de84d0a68fe8fc4b7683110b6b6fed.tar.gz volse-hubzilla-0808e4c930de84d0a68fe8fc4b7683110b6b6fed.tar.bz2 volse-hubzilla-0808e4c930de84d0a68fe8fc4b7683110b6b6fed.zip |
Merge branch 'pull'
Diffstat (limited to 'addon/poormancron/poormancron.php')
-rw-r--r-- | addon/poormancron/poormancron.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/addon/poormancron/poormancron.php b/addon/poormancron/poormancron.php index e09182f99..bbe023cd7 100644 --- a/addon/poormancron/poormancron.php +++ b/addon/poormancron/poormancron.php @@ -7,6 +7,21 @@ */ function poormancron_install() { + // check for command line php + $a = get_app(); + $ex = Array(); + $ex[0] = ((x($a->config,'php_path')) && (strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); + $ex[1] = dirname(dirname(dirname(__file__)))."/testargs.php"; + $ex[2] = "test"; + $out = exec(implode(" ", $ex)); + if ($out==="test") { + set_config('poormancron','usecli',1); + logger("poormancron will use cli php"); + } else { + set_config('poormancron','usecli',0); + logger("poormancron will NOT use cli php"); + } + register_hook('page_end', 'addon/poormancron/poormancron.php', 'poormancron_hook'); register_hook('proc_run', 'addon/poormancron/poormancron.php','poormancron_procrun'); logger("installed poormancron"); @@ -32,6 +47,7 @@ function poormancron_hook(&$a,&$b) { } function poormancron_procrun(&$a, &$arr) { + if (get_config('poormancron','usecli')==1) return; $argv = $arr['args']; $arr['run_cmd'] = false; logger("poormancron procrun ".implode(", ",$argv)); |