mirror of https://github.com/nextcloud/server.git
[9.2] Register commands in info.xml (#26248)
* Use DI to load console commands from the apps - class name to be defined in the info.xml * Load commands from info.xml * Fix unit test * Allow Di magic for IMountManager Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>pull/1705/head
parent
675230f86d
commit
c5ca71ee82
@ -1,39 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
||||
*
|
||||
* @author Joas Schilling <coding@schilljs.com>
|
||||
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
||||
*
|
||||
* @license AGPL-3.0
|
||||
*
|
||||
* This code is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License, version 3,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
use OCA\DAV\AppInfo\Application;
|
||||
use OCA\DAV\Command\CreateAddressBook;
|
||||
use OCA\DAV\Command\CreateCalendar;
|
||||
use OCA\DAV\Command\SyncBirthdayCalendar;
|
||||
use OCA\DAV\Command\SyncSystemAddressBook;
|
||||
|
||||
$dbConnection = \OC::$server->getDatabaseConnection();
|
||||
$userManager = OC::$server->getUserManager();
|
||||
$groupManager = OC::$server->getGroupManager();
|
||||
|
||||
$app = new Application();
|
||||
|
||||
/** @var Symfony\Component\Console\Application $application */
|
||||
$application->add(new CreateCalendar($userManager, $groupManager, $dbConnection));
|
||||
$application->add(new CreateAddressBook($userManager, $app->getContainer()->query(\OCA\DAV\CardDAV\CardDavBackend::class)));
|
||||
$application->add(new SyncSystemAddressBook($app->getSyncService()));
|
||||
$application->add(new SyncBirthdayCalendar($userManager, $app->getContainer()->query(\OCA\DAV\CalDAV\BirthdayService::class)));
|
@ -1,27 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
||||
*
|
||||
* @author Lukas Reschke <lukas@statuscode.ch>
|
||||
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
||||
*
|
||||
* @license AGPL-3.0
|
||||
*
|
||||
* This code is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License, version 3,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
$app = new \OCA\Federation\AppInfo\Application();
|
||||
$syncService = $app->getSyncService();
|
||||
|
||||
/** @var Symfony\Component\Console\Application $application */
|
||||
$application->add(new \OCA\Federation\Command\SyncFederationAddressBooks($syncService));
|
@ -1,34 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
||||
*
|
||||
* @author Bart Visscher <bartv@thisnet.nl>
|
||||
* @author Joas Schilling <coding@schilljs.com>
|
||||
* @author Morris Jobke <hey@morrisjobke.de>
|
||||
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
||||
*
|
||||
* @license AGPL-3.0
|
||||
*
|
||||
* This code is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License, version 3,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
|
||||
$dbConnection = \OC::$server->getDatabaseConnection();
|
||||
$userManager = OC::$server->getUserManager();
|
||||
$shareManager = \OC::$server->getShareManager();
|
||||
$mountManager = \OC::$server->getMountManager();
|
||||
|
||||
/** @var Symfony\Component\Console\Application $application */
|
||||
$application->add(new OCA\Files\Command\Scan($userManager));
|
||||
$application->add(new OCA\Files\Command\DeleteOrphanedFiles($dbConnection));
|
||||
$application->add(new OCA\Files\Command\TransferOwnership($userManager, $shareManager, $mountManager));
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
||||
*
|
||||
* @author Björn Schießle <bjoern@schiessle.org>
|
||||
*
|
||||
* @license AGPL-3.0
|
||||
*
|
||||
* This code is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License, version 3,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
use OCA\Files_Trashbin\AppInfo\Application;
|
||||
use OCA\Files_Trashbin\Command\CleanUp;
|
||||
use OCA\Files_Trashbin\Command\ExpireTrash;
|
||||
|
||||
$app = new Application();
|
||||
$expiration = $app->getContainer()->query('Expiration');
|
||||
$userManager = OC::$server->getUserManager();
|
||||
$rootFolder = \OC::$server->getRootFolder();
|
||||
$dbConnection = \OC::$server->getDatabaseConnection();
|
||||
|
||||
/** @var Symfony\Component\Console\Application $application */
|
||||
$application->add(new CleanUp($rootFolder, $userManager, $dbConnection));
|
||||
$application->add(new ExpireTrash($userManager, $expiration));
|
@ -1,34 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2016, ownCloud, Inc.
|
||||
*
|
||||
* @author Björn Schießle <bjoern@schiessle.org>
|
||||
*
|
||||
* @license AGPL-3.0
|
||||
*
|
||||
* This code is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License, version 3,
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
use OCA\Files_Versions\AppInfo\Application;
|
||||
use OCA\Files_Versions\Command\CleanUp;
|
||||
use OCA\Files_Versions\Command\ExpireVersions;
|
||||
|
||||
$app = new Application();
|
||||
$expiration = $app->getContainer()->query('Expiration');
|
||||
$userManager = OC::$server->getUserManager();
|
||||
$rootFolder = \OC::$server->getRootFolder();
|
||||
/** @var Symfony\Component\Console\Application $application */
|
||||
$application->add(new CleanUp($rootFolder, $userManager));
|
||||
$application->add(new ExpireVersions($userManager, $expiration));
|
Loading…
Reference in New Issue