diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-05-13 11:22:28 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-05-24 08:41:20 +0200 |
commit | 328b3c47d7fdf61b6de3c2d9129d392d3a9f5a87 (patch) | |
tree | 4d7f5eedc7861b40271bcfe1e95cc01d5ed0296d /apps/files_external/appinfo | |
parent | adcf942901fd567d97dbe105e8f3dfb7cea738e3 (diff) | |
download | nextcloud-server-328b3c47d7fdf61b6de3c2d9129d392d3a9f5a87.tar.gz nextcloud-server-328b3c47d7fdf61b6de3c2d9129d392d3a9f5a87.zip |
Move stuff from outside lib/ to PSR-4
Diffstat (limited to 'apps/files_external/appinfo')
-rw-r--r-- | apps/files_external/appinfo/app.php | 2 | ||||
-rw-r--r-- | apps/files_external/appinfo/application.php | 135 | ||||
-rw-r--r-- | apps/files_external/appinfo/info.xml | 2 | ||||
-rw-r--r-- | apps/files_external/appinfo/register_command.php | 6 | ||||
-rw-r--r-- | apps/files_external/appinfo/routes.php | 2 | ||||
-rw-r--r-- | apps/files_external/appinfo/update.php | 4 |
6 files changed, 8 insertions, 143 deletions
diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php index 18f8b2551fa..26358886c0b 100644 --- a/apps/files_external/appinfo/app.php +++ b/apps/files_external/appinfo/app.php @@ -31,7 +31,7 @@ OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php'; require_once __DIR__ . '/../3rdparty/autoload.php'; // register Application object singleton -\OC_Mount_Config::$app = new \OCA\Files_external\Appinfo\Application(); +\OC_Mount_Config::$app = new \OCA\Files_External\AppInfo\Application(); $appContainer = \OC_Mount_Config::$app->getContainer(); \OC_Mount_Config::$app->registerSettings(); diff --git a/apps/files_external/appinfo/application.php b/apps/files_external/appinfo/application.php deleted file mode 100644 index 5d490c6091f..00000000000 --- a/apps/files_external/appinfo/application.php +++ /dev/null @@ -1,135 +0,0 @@ -<?php -/** - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> - * @author Robin McCorkell <robin@mccorkell.me.uk> - * @author Roeland Jago Douma <rullzer@owncloud.com> - * @author Ross Nicoll <jrn@jrn.me.uk> - * @author Vincent Petry <pvince81@owncloud.com> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @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/> - * - */ - -namespace OCA\Files_External\AppInfo; - -use \OCP\AppFramework\App; -use OCP\AppFramework\IAppContainer; -use \OCP\IContainer; -use \OCA\Files_External\Service\BackendService; -use \OCA\Files_External\Lib\Config\IBackendProvider; -use \OCA\Files_External\Lib\Config\IAuthMechanismProvider; - -/** - * @package OCA\Files_External\Appinfo - */ -class Application extends App implements IBackendProvider, IAuthMechanismProvider { - - public function __construct(array $urlParams = array()) { - parent::__construct('files_external', $urlParams); - - $container = $this->getContainer(); - - $container->registerService('OCP\Files\Config\IUserMountCache', function (IAppContainer $c) { - return $c->getServer()->query('UserMountCache'); - }); - - $backendService = $container->query('OCA\\Files_External\\Service\\BackendService'); - $backendService->registerBackendProvider($this); - $backendService->registerAuthMechanismProvider($this); - - // app developers: do NOT depend on this! it will disappear with oC 9.0! - \OC::$server->getEventDispatcher()->dispatch( - 'OCA\\Files_External::loadAdditionalBackends' - ); - } - - /** - * Register settings templates - */ - public function registerSettings() { - $container = $this->getContainer(); - $backendService = $container->query('OCA\\Files_External\\Service\\BackendService'); - - \OCP\App::registerAdmin('files_external', 'settings'); - \OCP\App::registerPersonal('files_external', 'personal'); - } - - /** - * @{inheritdoc} - */ - public function getBackends() { - $container = $this->getContainer(); - - $backends = [ - $container->query('OCA\Files_External\Lib\Backend\Local'), - $container->query('OCA\Files_External\Lib\Backend\FTP'), - $container->query('OCA\Files_External\Lib\Backend\DAV'), - $container->query('OCA\Files_External\Lib\Backend\OwnCloud'), - $container->query('OCA\Files_External\Lib\Backend\SFTP'), - $container->query('OCA\Files_External\Lib\Backend\AmazonS3'), - $container->query('OCA\Files_External\Lib\Backend\Dropbox'), - $container->query('OCA\Files_External\Lib\Backend\Google'), - $container->query('OCA\Files_External\Lib\Backend\Swift'), - $container->query('OCA\Files_External\Lib\Backend\SFTP_Key'), - ]; - - if (!\OC_Util::runningOnWindows()) { - $backends += [ - $container->query('OCA\Files_External\Lib\Backend\SMB'), - $container->query('OCA\Files_External\Lib\Backend\SMB_OC'), - ]; - } - - return $backends; - } - - /** - * @{inheritdoc} - */ - public function getAuthMechanisms() { - $container = $this->getContainer(); - - return [ - // AuthMechanism::SCHEME_NULL mechanism - $container->query('OCA\Files_External\Lib\Auth\NullMechanism'), - - // AuthMechanism::SCHEME_BUILTIN mechanism - $container->query('OCA\Files_External\Lib\Auth\Builtin'), - - // AuthMechanism::SCHEME_PASSWORD mechanisms - $container->query('OCA\Files_External\Lib\Auth\Password\Password'), - $container->query('OCA\Files_External\Lib\Auth\Password\SessionCredentials'), - - // AuthMechanism::SCHEME_OAUTH1 mechanisms - $container->query('OCA\Files_External\Lib\Auth\OAuth1\OAuth1'), - - // AuthMechanism::SCHEME_OAUTH2 mechanisms - $container->query('OCA\Files_External\Lib\Auth\OAuth2\OAuth2'), - - // AuthMechanism::SCHEME_PUBLICKEY mechanisms - $container->query('OCA\Files_External\Lib\Auth\PublicKey\RSA'), - - // AuthMechanism::SCHEME_OPENSTACK mechanisms - $container->query('OCA\Files_External\Lib\Auth\OpenStack\OpenStack'), - $container->query('OCA\Files_External\Lib\Auth\OpenStack\Rackspace'), - - // Specialized mechanisms - $container->query('OCA\Files_External\Lib\Auth\AmazonS3\AccessKey'), - ]; - } - -} diff --git a/apps/files_external/appinfo/info.xml b/apps/files_external/appinfo/info.xml index 2b192c94aa4..25df58c6368 100644 --- a/apps/files_external/appinfo/info.xml +++ b/apps/files_external/appinfo/info.xml @@ -19,6 +19,8 @@ </types> <ocsid>166048</ocsid> + <namespace>Files_External</namespace> + <dependencies> <owncloud min-version="9.1" max-version="9.1" /> </dependencies> diff --git a/apps/files_external/appinfo/register_command.php b/apps/files_external/appinfo/register_command.php index 927ce9869f9..65ac2286fa0 100644 --- a/apps/files_external/appinfo/register_command.php +++ b/apps/files_external/appinfo/register_command.php @@ -37,9 +37,9 @@ $groupManager = OC::$server->getGroupManager(); $app = \OC_Mount_Config::$app; -$globalStorageService = $app->getContainer()->query('\OCA\Files_external\Service\GlobalStoragesService'); -$userStorageService = $app->getContainer()->query('\OCA\Files_external\Service\UserStoragesService'); -$importLegacyStorageService = $app->getContainer()->query('\OCA\Files_external\Service\ImportLegacyStoragesService'); +$globalStorageService = $app->getContainer()->query('\OCA\Files_External\Service\GlobalStoragesService'); +$userStorageService = $app->getContainer()->query('\OCA\Files_External\Service\UserStoragesService'); +$importLegacyStorageService = $app->getContainer()->query('\OCA\Files_External\Service\ImportLegacyStoragesService'); $backendService = $app->getContainer()->query('OCA\Files_External\Service\BackendService'); /** @var Symfony\Component\Console\Application $application */ diff --git a/apps/files_external/appinfo/routes.php b/apps/files_external/appinfo/routes.php index e2f55e652a8..703b2cd265f 100644 --- a/apps/files_external/appinfo/routes.php +++ b/apps/files_external/appinfo/routes.php @@ -26,8 +26,6 @@ * */ -namespace OCA\Files_External\AppInfo; - /** * @var $this \OCP\Route\IRouter **/ diff --git a/apps/files_external/appinfo/update.php b/apps/files_external/appinfo/update.php index 8cc2422c7ff..62dfbadc936 100644 --- a/apps/files_external/appinfo/update.php +++ b/apps/files_external/appinfo/update.php @@ -21,10 +21,10 @@ $installedVersion = \OC::$server->getConfig()->getAppValue('files_external', 'installed_version'); -$app = new \OCA\Files_external\Appinfo\Application(); +$app = new \OCA\Files_External\AppInfo\Application(); // Migration to db config if (version_compare($installedVersion, '0.5.0', '<')) { - $migrator = $app->getContainer()->query('OCA\Files_external\Migration\StorageMigrator'); + $migrator = $app->getContainer()->query('OCA\Files_External\Migration\StorageMigrator'); $migrator->migrateGlobal(); } |