public function setUp() { parent::setUp(); $app = new Application(); $this->container = $app->getContainer(); $app->registerSettings(); }
public function setUp() { parent::setUp(); $app = new Application(); $this->container = $app->getContainer(); $this->backupService = $this->container->query('OCA\\OwnBackup\\Service\\BackupService'); $this->db = $this->container->query('OCP\\IDb'); }
/** * @param array $arguments */ public function run($arguments) { if (!App::isEnabled('ownbackup')) { return; } $app = new Application(); $container = $app->getContainer(); /** @var BackupService $backupService */ $backupService = $container->query('OCA\\OwnBackup\\Service\\BackupService'); // check if we need a new backup if ($backupService->needNewBackup()) { // create new backup $backupService->createDBBackup(); // expiring old backups $backupService->expireOldBackups(); } }
<?php /** * ownCloud - ownbackup * * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * * @author Patrizio Bekerle <*****@*****.**> * @copyright Patrizio Bekerle 2015 */ namespace OCA\OwnBackup\AppInfo; use OCA\OwnBackup\Jobs\BackupJob; // I need this line so OwnBackup shows up in ownCloud 8.1.1, but in my ownCloud 8.1.1 development version from git // it shows up two times because of it $app = new Application(); $app->registerSettings(); \OC::$server->getJobList()->add(new BackupJob());
<?php /** * ownCloud - ownbackup * * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * * @author Patrizio Bekerle <*****@*****.**> * @copyright Patrizio Bekerle 2015 */ namespace OCA\OwnBackup; use OCA\OwnBackup\AppInfo\Application; $app = new Application(); $container = $app->getContainer(); $response = $container->query('\\OCA\\OwnBackup\\Controller\\AdminController')->index(); return $response->render();