Skip to content

Commit

Permalink
Better async detection
Browse files Browse the repository at this point in the history
  • Loading branch information
xfra35 committed Dec 21, 2015
1 parent 84c2eae commit 6b76c57
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,10 @@ function __construct() {
if (isset($config['presets']))
foreach($config['presets'] as $name=>$expr)
$this->preset($name,is_array($expr)?implode(',',$expr):$expr);
if (function_exists('exec') && exec('php -r "echo 1+3;"')=='4')
$this->async=TRUE;
if (function_exists('exec')) {
exec('php -v 2>&1',$out,$ret);
$this->async=$ret==0;// check if the `php` binary is in the path and can be executed
}
$f3->route(array('GET /cron','GET /cron/@job'),array($this,'route'));
}

Expand Down

0 comments on commit 6b76c57

Please sign in to comment.