mirror of
https://github.com/getgrav/grav.git
synced 2025-10-26 07:56:07 +01:00
Added support for a backlink in scheduler
This commit is contained in:
@@ -62,6 +62,7 @@ class Backups
|
||||
$job = $scheduler->addFunction('Grav\Common\Backup\Backups::backup', [$id], $name );
|
||||
$job->at($at);
|
||||
$job->output($logs);
|
||||
$job->backlink('/tools/backups');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -602,6 +602,7 @@ class Cache extends Getters
|
||||
$job = $scheduler->addFunction('Grav\Common\Cache::purgeJob', [], $name );
|
||||
$job->at($at);
|
||||
$job->output($logs);
|
||||
$job->backlink('/config/system#caching');
|
||||
|
||||
// Cache Clear
|
||||
$at = $config->get('system.cache.clear_at');
|
||||
@@ -612,6 +613,7 @@ class Cache extends Getters
|
||||
$job = $scheduler->addFunction('Grav\Common\Cache::clearJob', [$clear_type], $name );
|
||||
$job->at($at);
|
||||
$job->output($logs);
|
||||
$job->backlink('/config/system#caching');
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ class Job
|
||||
private $outputMode;
|
||||
private $process;
|
||||
private $successful = false;
|
||||
private $backlink;
|
||||
|
||||
/**
|
||||
* Create a new Job instance.
|
||||
@@ -183,6 +184,22 @@ class Job
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets/Gets an option backlink
|
||||
*
|
||||
* @param $link string
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function backlink($link = null)
|
||||
{
|
||||
if ($link) {
|
||||
$this->backlink = $link;
|
||||
}
|
||||
return $this->backlink;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if the Job can run in background.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user