diff options
author | fabrixxm <fabrix.xm@gmail.com> | 2011-08-22 13:56:08 +0200 |
---|---|---|
committer | fabrixxm <fabrix.xm@gmail.com> | 2011-08-22 13:56:08 +0200 |
commit | d8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75 (patch) | |
tree | dbdc1dbffe5c56dcff18669e957f679b5ae37bb3 /addon/poormancron/poormancron.php | |
parent | afdc639f17f0f5e12f291b512ccc12b3df6b2acf (diff) | |
parent | 564ade0685470158ac487d9a9f18a21079c729bb (diff) | |
download | volse-hubzilla-d8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75.tar.gz volse-hubzilla-d8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75.tar.bz2 volse-hubzilla-d8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75.zip |
Merge branch 'master' into newui
Diffstat (limited to 'addon/poormancron/poormancron.php')
-rw-r--r-- | addon/poormancron/poormancron.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/addon/poormancron/poormancron.php b/addon/poormancron/poormancron.php index 7611c43be..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"); @@ -31,7 +46,10 @@ function poormancron_hook(&$a,&$b) { } } -function poormancron_procrun(&$a, $argv) { +function poormancron_procrun(&$a, &$arr) { + if (get_config('poormancron','usecli')==1) return; + $argv = $arr['args']; + $arr['run_cmd'] = false; logger("poormancron procrun ".implode(", ",$argv)); array_shift($argv); $argc = count($argv); |