Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move files external to core #25422

Merged
merged 2 commits into from
Nov 21, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/encryption/lib/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ private function renameFileKeys($user, $path, $trash = false) {
* @return array
*/
protected function getSystemMountPoints() {
return \OC_Mount_Config::getSystemMountPoints();
return \OC\Files\External\LegacyUtil::getSystemMountPoints();
}

/**
Expand Down
2 changes: 0 additions & 2 deletions apps/files_external/appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,3 @@
"name" => $l->t('External storage')
]);

$mountProvider = $appContainer->query('OCA\Files_External\Config\ConfigAdapter');
\OC::$server->getMountProviderCollection()->registerProvider($mountProvider);
225 changes: 0 additions & 225 deletions apps/files_external/appinfo/database.xml

This file was deleted.

2 changes: 1 addition & 1 deletion apps/files_external/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<admin>admin-external-storage</admin>
</documentation>
<rememberlogin>false</rememberlogin>
<version>0.6.0</version>
<version>0.7.0</version>
<types>
<filesystem/>
</types>
Expand Down
42 changes: 16 additions & 26 deletions apps/files_external/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
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;
use \OCP\Files\External\IStoragesBackendService;
use \OCP\Files\External\Config\IBackendProvider;
use \OCP\Files\External\Config\IAuthMechanismProvider;

/**
* @package OCA\Files_External\AppInfo
Expand All @@ -47,28 +47,28 @@ public function __construct(array $urlParams = []) {
$container->registerService('OCP\Files\Config\IUserMountCache', function (IAppContainer $c) {
return $c->getServer()->query('UserMountCache');
});
$container->registerService('OCP\Files\External\IStoragesBackendService', function (IAppContainer $c) {
return $c->getServer()->query('StoragesBackendService');
});
$container->registerService('OCP\Files\External\Service\IGlobalStoragesService', function (IAppContainer $c) {
return $c->getServer()->query('OCP\Files\External\Service\IGlobalStoragesService');
});
$container->registerService('OCP\Files\External\Service\IUserGlobalStoragesService', function (IAppContainer $c) {
return $c->getServer()->query('OCP\Files\External\Service\IUserGlobalStoragesService');
});
$container->registerService('OCP\Files\External\Service\IUserStoragesService', function (IAppContainer $c) {
return $c->getServer()->query('OCP\Files\External\Service\IUserStoragesService');
});

$backendService = $container->query('OCA\\Files_External\\Service\\BackendService');
$backendService = $container->getServer()->query('StoragesBackendService');
$backendService->registerBackendProvider($this);
$backendService->registerAuthMechanismProvider($this);

// force-load auth mechanisms since some will register hooks
// TODO: obsolete these and use the TokenProvider to get the user's password from the session
$this->getAuthMechanisms();

// 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');
}
Expand Down Expand Up @@ -103,16 +103,6 @@ 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'),

Expand Down
12 changes: 6 additions & 6 deletions apps/files_external/lib/Command/Applicable.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
namespace OCA\Files_External\Command;

use OC\Core\Command\Base;
use OCA\Files_External\Lib\StorageConfig;
use OCA\Files_External\NotFoundException;
use OCA\Files_External\Service\GlobalStoragesService;
use OCP\Files\External\IStorageConfig;
use OCP\Files\External\NotFoundException;
use OCP\Files\External\Service\IGlobalStoragesService;
use OCP\IGroupManager;
use OCP\IUserManager;
use Symfony\Component\Console\Input\InputArgument;
Expand All @@ -35,7 +35,7 @@

class Applicable extends Base {
/**
* @var GlobalStoragesService
* @var IGlobalStoragesService
*/
protected $globalService;

Expand All @@ -50,7 +50,7 @@ class Applicable extends Base {
private $groupManager;

function __construct(
GlobalStoragesService $globalService,
IGlobalStoragesService $globalService,
IUserManager $userManager,
IGroupManager $groupManager
) {
Expand Down Expand Up @@ -106,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
return 404;
}

if ($mount->getType() === StorageConfig::MOUNT_TYPE_PERSONAl) {
if ($mount->getType() === IStorageConfig::MOUNT_TYPE_PERSONAl) {
$output->writeln('<error>Can\'t change applicables on personal mounts</error>');
return 1;
}
Expand Down
12 changes: 6 additions & 6 deletions apps/files_external/lib/Command/Backends.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
namespace OCA\Files_External\Command;

use OC\Core\Command\Base;
use OCA\Files_External\Lib\Auth\AuthMechanism;
use OCA\Files_External\Lib\Backend\Backend;
use OCA\Files_External\Lib\DefinitionParameter;
use OCA\Files_External\Service\BackendService;
use OCP\Files\External\Auth\AuthMechanism;
use OCP\Files\External\Backend\Backend;
use OCP\Files\External\DefinitionParameter;
use OCP\Files\External\IStoragesBackendService;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableHelper;
Expand All @@ -37,10 +37,10 @@
use Symfony\Component\Console\Output\OutputInterface;

class Backends extends Base {
/** @var BackendService */
/** @var IStoragesBackendService */
private $backendService;

function __construct(BackendService $backendService
function __construct(IStoragesBackendService $backendService
) {
parent::__construct();

Expand Down
Loading