mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-22 05:49:03 +01:00
fix Scurtinizer bug by explicitly returning $other_cronlines instead of not declared class var
This commit is contained in:
parent
87f54ac14f
commit
b400f38b75
@ -632,10 +632,15 @@ class Asyncservice
|
||||
/**
|
||||
* checks if phpgwapi/cron/asyncservices.php is installed as cron-job
|
||||
*
|
||||
* @param array& $other_cronlines =array() on return other cronlines found
|
||||
* @return array the times asyncservices are run (normaly 'min'=>'* /5') or False if not installed or 0 if crontab not found
|
||||
* Not implemented for Windows at the moment, always returns 0
|
||||
*/
|
||||
function installed()
|
||||
/**
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function installed(array &$other_cronlines=array())
|
||||
{
|
||||
if ($this->only_fallback) {
|
||||
return 0;
|
||||
@ -648,7 +653,7 @@ class Asyncservice
|
||||
return 0;
|
||||
}
|
||||
$times = False;
|
||||
$this->other_cronlines = array();
|
||||
$other_cronlines = array();
|
||||
if (($crontab = popen('/bin/sh -c "'.$this->crontab.' -l" 2>&1','r')) !== False)
|
||||
{
|
||||
$n = 0;
|
||||
@ -678,7 +683,7 @@ class Asyncservice
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->other_cronlines[] = $line;
|
||||
$other_cronlines[] = $line;
|
||||
}
|
||||
}
|
||||
@pclose($crontab);
|
||||
@ -701,17 +706,15 @@ class Asyncservice
|
||||
if ($this->only_fallback && $times !== False) {
|
||||
return 0;
|
||||
}
|
||||
$this->installed(); // find other installed cronlines
|
||||
$other_cronlines = array();
|
||||
$this->installed($other_cronlines); // find other installed cronlines
|
||||
|
||||
if (($crontab = popen('/bin/sh -c "'.$this->crontab.' -" 2>&1','w')) !== False)
|
||||
{
|
||||
if (is_array($this->other_cronlines))
|
||||
{
|
||||
foreach ($this->other_cronlines as $cronline)
|
||||
foreach ($other_cronlines as $cronline)
|
||||
{
|
||||
fwrite($crontab,$cronline); // preserv the other lines on install
|
||||
}
|
||||
}
|
||||
if ($times !== False)
|
||||
{
|
||||
$cron_units = array('min','hour','day','month','dow');
|
||||
|
Loading…
Reference in New Issue
Block a user