diff options
author | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-09-30 11:09:52 +0300 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-11 20:48:26 +0300 |
commit | c5ca71ee8289886c5892880679b200755fdc6dcc (patch) | |
tree | 040b66c0ea15d3c95000613fb14374f5fa5ffd5b /apps/files_versions/appinfo | |
parent | 675230f86d74325d41cec4df59578919241934ce (diff) |
[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>
Diffstat (limited to 'apps/files_versions/appinfo')
-rw-r--r-- | apps/files_versions/appinfo/info.xml | 6 | ||||
-rw-r--r-- | apps/files_versions/appinfo/register_command.php | 34 |
2 files changed, 5 insertions, 35 deletions
diff --git a/apps/files_versions/appinfo/info.xml b/apps/files_versions/appinfo/info.xml index b167104016a..026ed406d7c 100644 --- a/apps/files_versions/appinfo/info.xml +++ b/apps/files_versions/appinfo/info.xml @@ -7,7 +7,6 @@ <description> This application automatically maintains older versions of files that are changed. When enabled, a hidden versions folder is provisioned in every user’s directory and is used to store old file versions. A user can revert to an older version through the web interface at any time, with the replaced file becoming a version. The app automatically manages the versions folder to ensure the user doesn’t run out of Quota because of versions. In addition to the expiry of versions, the versions app makes certain never to use more than 50% of the user’s currently available free space. If stored versions exceed this limit, the app will delete the oldest versions first until it meets this limit. More information is available in the Versions documentation. - </description> <version>1.4.0</version> <types> @@ -25,4 +24,9 @@ In addition to the expiry of versions, the versions app makes certain never to u <background-jobs> <job>OCA\Files_Versions\BackgroundJob\ExpireVersions</job> </background-jobs> + + <commands> + <command>OCA\Files_Versions\Command\CleanUp</command> + <command>OCA\Files_Versions\Command\ExpireVersions</command> + </commands> </info> diff --git a/apps/files_versions/appinfo/register_command.php b/apps/files_versions/appinfo/register_command.php deleted file mode 100644 index bca869075aa..00000000000 --- a/apps/files_versions/appinfo/register_command.php +++ /dev/null @@ -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)); |