2012-08-09 23:23:31 +04:00
|
|
|
<?php
|
|
|
|
/**
|
2014-04-19 20:16:55 +04:00
|
|
|
* ownCloud - News
|
|
|
|
*
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later. See the COPYING file.
|
|
|
|
*
|
|
|
|
* @author Alessandro Cosentino <cosenal@gmail.com>
|
|
|
|
* @author Bernhard Posselt <dev@bernhard-posselt.com>
|
|
|
|
* @copyright Alessandro Cosentino 2012
|
|
|
|
* @copyright Bernhard Posselt 2012, 2014
|
|
|
|
*/
|
2012-08-09 23:23:31 +04:00
|
|
|
|
2013-03-25 14:48:15 +04:00
|
|
|
|
2014-05-15 05:43:27 +04:00
|
|
|
namespace OCA\News\Cron;
|
2013-03-23 17:39:23 +04:00
|
|
|
|
2014-05-11 15:50:25 +04:00
|
|
|
use \OCA\News\AppInfo\Application;
|
2012-08-09 23:23:31 +04:00
|
|
|
|
2012-10-14 23:15:16 +04:00
|
|
|
|
2014-05-15 05:43:27 +04:00
|
|
|
class Updater {
|
2012-10-14 23:15:16 +04:00
|
|
|
|
|
|
|
|
2014-10-21 18:45:36 +04:00
|
|
|
static public function run() {
|
|
|
|
$app = new Application();
|
|
|
|
|
|
|
|
$container = $app->getContainer();
|
|
|
|
|
|
|
|
// make it possible to turn off cron updates if you use an external
|
|
|
|
// script to execute updates in parallel
|
2014-12-17 21:20:21 +03:00
|
|
|
if ($container->query('OCA\News\Config\Config')->getUseCronUpdates()) {
|
|
|
|
$container->query('OCA\News\Utility\Updater')->beforeUpdate();
|
|
|
|
$container->query('OCA\News\Utility\Updater')->update();
|
|
|
|
$container->query('OCA\News\Utility\Updater')->afterUpdate();
|
2014-10-21 18:45:36 +04:00
|
|
|
}
|
|
|
|
}
|
2012-10-14 23:15:16 +04:00
|
|
|
|
|
|
|
|
2012-08-09 23:23:31 +04:00
|
|
|
}
|