2016-02-12 08:19:29 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class UpdateDocsCronTask implements CronTask
|
|
|
|
{
|
2016-03-22 06:14:39 +01:00
|
|
|
/**
|
|
|
|
* @var SS_HTTPRequest $request The request object the controller was called with.
|
|
|
|
*/
|
|
|
|
protected $request = null;
|
|
|
|
|
2016-02-12 08:19:29 +01:00
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getSchedule()
|
|
|
|
{
|
|
|
|
return "0 20 * * *";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return BuildTask
|
|
|
|
*/
|
|
|
|
public function process()
|
|
|
|
{
|
2016-03-22 06:14:39 +01:00
|
|
|
|
|
|
|
$this->request = Controller::curr()->getRequest();
|
2016-02-12 08:19:29 +01:00
|
|
|
|
|
|
|
//refresh markdown files
|
|
|
|
$refresh_task = new RefreshMarkdownTask();
|
2016-03-22 06:14:39 +01:00
|
|
|
$refresh_task->run($this->request);
|
2016-02-12 08:19:29 +01:00
|
|
|
|
|
|
|
//reindex markdown files
|
|
|
|
$reindex_task = new RebuildLuceneDocsIndex();
|
2016-03-22 06:14:39 +01:00
|
|
|
$reindex_task->run($this->request);
|
2016-02-12 08:19:29 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|