Merge pull request #24619 from owncloud/files_external-psr4
Move files_external to PSR-4
This commit is contained in:
commit
c60ef7deb8
|
@ -31,7 +31,7 @@ OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php';
|
||||||
require_once __DIR__ . '/../3rdparty/autoload.php';
|
require_once __DIR__ . '/../3rdparty/autoload.php';
|
||||||
|
|
||||||
// register Application object singleton
|
// 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();
|
$appContainer = \OC_Mount_Config::$app->getContainer();
|
||||||
|
|
||||||
\OC_Mount_Config::$app->registerSettings();
|
\OC_Mount_Config::$app->registerSettings();
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
</types>
|
</types>
|
||||||
<ocsid>166048</ocsid>
|
<ocsid>166048</ocsid>
|
||||||
|
|
||||||
|
<namespace>Files_External</namespace>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<owncloud min-version="9.1" max-version="9.1" />
|
<owncloud min-version="9.1" max-version="9.1" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -37,9 +37,9 @@ $groupManager = OC::$server->getGroupManager();
|
||||||
|
|
||||||
$app = \OC_Mount_Config::$app;
|
$app = \OC_Mount_Config::$app;
|
||||||
|
|
||||||
$globalStorageService = $app->getContainer()->query('\OCA\Files_external\Service\GlobalStoragesService');
|
$globalStorageService = $app->getContainer()->query('\OCA\Files_External\Service\GlobalStoragesService');
|
||||||
$userStorageService = $app->getContainer()->query('\OCA\Files_external\Service\UserStoragesService');
|
$userStorageService = $app->getContainer()->query('\OCA\Files_External\Service\UserStoragesService');
|
||||||
$importLegacyStorageService = $app->getContainer()->query('\OCA\Files_external\Service\ImportLegacyStoragesService');
|
$importLegacyStorageService = $app->getContainer()->query('\OCA\Files_External\Service\ImportLegacyStoragesService');
|
||||||
$backendService = $app->getContainer()->query('OCA\Files_External\Service\BackendService');
|
$backendService = $app->getContainer()->query('OCA\Files_External\Service\BackendService');
|
||||||
|
|
||||||
/** @var Symfony\Component\Console\Application $application */
|
/** @var Symfony\Component\Console\Application $application */
|
||||||
|
|
|
@ -26,8 +26,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Files_External\AppInfo;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var $this \OCP\Route\IRouter
|
* @var $this \OCP\Route\IRouter
|
||||||
**/
|
**/
|
||||||
|
|
|
@ -21,10 +21,10 @@
|
||||||
|
|
||||||
$installedVersion = \OC::$server->getConfig()->getAppValue('files_external', 'installed_version');
|
$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
|
// Migration to db config
|
||||||
if (version_compare($installedVersion, '0.5.0', '<')) {
|
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();
|
$migrator->migrateGlobal();
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ use \OCA\Files_External\Lib\Config\IBackendProvider;
|
||||||
use \OCA\Files_External\Lib\Config\IAuthMechanismProvider;
|
use \OCA\Files_External\Lib\Config\IAuthMechanismProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @package OCA\Files_External\Appinfo
|
* @package OCA\Files_External\AppInfo
|
||||||
*/
|
*/
|
||||||
class Application extends App implements IBackendProvider, IAuthMechanismProvider {
|
class Application extends App implements IBackendProvider, IAuthMechanismProvider {
|
||||||
|
|
|
@ -22,14 +22,11 @@
|
||||||
namespace OCA\Files_External\Command;
|
namespace OCA\Files_External\Command;
|
||||||
|
|
||||||
use OC\Core\Command\Base;
|
use OC\Core\Command\Base;
|
||||||
use OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use OCA\Files_external\NotFoundException;
|
use OCA\Files_External\NotFoundException;
|
||||||
use OCA\Files_external\Service\GlobalStoragesService;
|
use OCA\Files_External\Service\GlobalStoragesService;
|
||||||
use OCP\IGroupManager;
|
use OCP\IGroupManager;
|
||||||
use OCP\IUserManager;
|
use OCP\IUserManager;
|
||||||
use Symfony\Component\Console\Command\Command;
|
|
||||||
use Symfony\Component\Console\Helper\Table;
|
|
||||||
use Symfony\Component\Console\Helper\TableHelper;
|
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
|
@ -22,9 +22,9 @@
|
||||||
namespace OCA\Files_External\Command;
|
namespace OCA\Files_External\Command;
|
||||||
|
|
||||||
use OC\Core\Command\Base;
|
use OC\Core\Command\Base;
|
||||||
use OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use OCA\Files_external\NotFoundException;
|
use OCA\Files_External\NotFoundException;
|
||||||
use OCA\Files_external\Service\GlobalStoragesService;
|
use OCA\Files_External\Service\GlobalStoragesService;
|
||||||
use Symfony\Component\Console\Command\Command;
|
use Symfony\Component\Console\Command\Command;
|
||||||
use Symfony\Component\Console\Helper\Table;
|
use Symfony\Component\Console\Helper\Table;
|
||||||
use Symfony\Component\Console\Helper\TableHelper;
|
use Symfony\Component\Console\Helper\TableHelper;
|
|
@ -27,21 +27,16 @@ use OC\User\NoUserException;
|
||||||
use OCA\Files_External\Lib\Auth\AuthMechanism;
|
use OCA\Files_External\Lib\Auth\AuthMechanism;
|
||||||
use OCA\Files_External\Lib\Backend\Backend;
|
use OCA\Files_External\Lib\Backend\Backend;
|
||||||
use OCA\Files_External\Lib\DefinitionParameter;
|
use OCA\Files_External\Lib\DefinitionParameter;
|
||||||
use OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use OCA\Files_External\Service\BackendService;
|
use OCA\Files_External\Service\BackendService;
|
||||||
use OCA\Files_external\Service\GlobalStoragesService;
|
use OCA\Files_External\Service\GlobalStoragesService;
|
||||||
use OCA\Files_external\Service\ImportLegacyStoragesService;
|
use OCA\Files_External\Service\UserStoragesService;
|
||||||
use OCA\Files_external\Service\UserStoragesService;
|
|
||||||
use OCP\IUserManager;
|
use OCP\IUserManager;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
use Symfony\Component\Console\Command\Command;
|
|
||||||
use Symfony\Component\Console\Helper\Table;
|
|
||||||
use Symfony\Component\Console\Helper\TableHelper;
|
|
||||||
use Symfony\Component\Console\Input\ArrayInput;
|
use Symfony\Component\Console\Input\ArrayInput;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Input\Input;
|
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
class Create extends Base {
|
class Create extends Base {
|
|
@ -22,15 +22,11 @@
|
||||||
namespace OCA\Files_External\Command;
|
namespace OCA\Files_External\Command;
|
||||||
|
|
||||||
use OC\Core\Command\Base;
|
use OC\Core\Command\Base;
|
||||||
use OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\NotFoundException;
|
||||||
use OCA\Files_external\NotFoundException;
|
use OCA\Files_External\Service\GlobalStoragesService;
|
||||||
use OCA\Files_external\Service\GlobalStoragesService;
|
use OCA\Files_External\Service\UserStoragesService;
|
||||||
use OCA\Files_external\Service\UserStoragesService;
|
|
||||||
use OCP\IUserManager;
|
use OCP\IUserManager;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
use Symfony\Component\Console\Command\Command;
|
|
||||||
use Symfony\Component\Console\Helper\Table;
|
|
||||||
use Symfony\Component\Console\Helper\TableHelper;
|
|
||||||
use Symfony\Component\Console\Input\ArrayInput;
|
use Symfony\Component\Console\Input\ArrayInput;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
|
@ -23,21 +23,17 @@ namespace OCA\Files_External\Command;
|
||||||
|
|
||||||
use OC\Core\Command\Base;
|
use OC\Core\Command\Base;
|
||||||
use OC\User\NoUserException;
|
use OC\User\NoUserException;
|
||||||
use OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use OCA\Files_External\Service\BackendService;
|
use OCA\Files_External\Service\BackendService;
|
||||||
use OCA\Files_external\Service\GlobalStoragesService;
|
use OCA\Files_External\Service\GlobalStoragesService;
|
||||||
use OCA\Files_external\Service\ImportLegacyStoragesService;
|
use OCA\Files_External\Service\ImportLegacyStoragesService;
|
||||||
use OCA\Files_external\Service\UserStoragesService;
|
use OCA\Files_External\Service\UserStoragesService;
|
||||||
use OCP\IUserManager;
|
use OCP\IUserManager;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
use Symfony\Component\Console\Command\Command;
|
|
||||||
use Symfony\Component\Console\Helper\Table;
|
|
||||||
use Symfony\Component\Console\Helper\TableHelper;
|
|
||||||
use Symfony\Component\Console\Input\ArrayInput;
|
use Symfony\Component\Console\Input\ArrayInput;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Input\Input;
|
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
class Import extends Base {
|
class Import extends Base {
|
|
@ -23,12 +23,11 @@ namespace OCA\Files_External\Command;
|
||||||
|
|
||||||
use OC\Core\Command\Base;
|
use OC\Core\Command\Base;
|
||||||
use OC\User\NoUserException;
|
use OC\User\NoUserException;
|
||||||
use OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use OCA\Files_external\Service\GlobalStoragesService;
|
use OCA\Files_External\Service\GlobalStoragesService;
|
||||||
use OCA\Files_external\Service\UserStoragesService;
|
use OCA\Files_External\Service\UserStoragesService;
|
||||||
use OCP\IUserManager;
|
use OCP\IUserManager;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
use Symfony\Component\Console\Command\Command;
|
|
||||||
use Symfony\Component\Console\Helper\Table;
|
use Symfony\Component\Console\Helper\Table;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
|
@ -21,18 +21,8 @@
|
||||||
|
|
||||||
namespace OCA\Files_External\Command;
|
namespace OCA\Files_External\Command;
|
||||||
|
|
||||||
use OC\Core\Command\Base;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use OCA\Files_external\Lib\StorageConfig;
|
|
||||||
use OCA\Files_external\Service\GlobalStoragesService;
|
|
||||||
use OCA\Files_external\Service\UserStoragesService;
|
|
||||||
use OCP\IUserManager;
|
|
||||||
use OCP\IUserSession;
|
|
||||||
use Symfony\Component\Console\Command\Command;
|
|
||||||
use Symfony\Component\Console\Helper\Table;
|
|
||||||
use Symfony\Component\Console\Helper\TableHelper;
|
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
class Option extends Config {
|
class Option extends Config {
|
|
@ -25,13 +25,10 @@ use OC\Core\Command\Base;
|
||||||
use OCA\Files_External\Lib\Auth\AuthMechanism;
|
use OCA\Files_External\Lib\Auth\AuthMechanism;
|
||||||
use OCA\Files_External\Lib\Backend\Backend;
|
use OCA\Files_External\Lib\Backend\Backend;
|
||||||
use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
|
use OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
|
||||||
use OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use OCA\Files_external\NotFoundException;
|
use OCA\Files_External\NotFoundException;
|
||||||
use OCA\Files_external\Service\GlobalStoragesService;
|
use OCA\Files_External\Service\GlobalStoragesService;
|
||||||
use OCP\Files\StorageNotAvailableException;
|
use OCP\Files\StorageNotAvailableException;
|
||||||
use Symfony\Component\Console\Command\Command;
|
|
||||||
use Symfony\Component\Console\Helper\Table;
|
|
||||||
use Symfony\Component\Console\Helper\TableHelper;
|
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
|
@ -24,14 +24,14 @@
|
||||||
namespace OCA\Files_External\Config;
|
namespace OCA\Files_External\Config;
|
||||||
|
|
||||||
use OC\Files\Storage\Wrapper\Availability;
|
use OC\Files\Storage\Wrapper\Availability;
|
||||||
use OCA\Files_external\Migration\StorageMigrator;
|
use OCA\Files_External\Migration\StorageMigrator;
|
||||||
use OCP\Files\Storage;
|
use OCP\Files\Storage;
|
||||||
use OC\Files\Mount\MountPoint;
|
use OC\Files\Mount\MountPoint;
|
||||||
use OCP\Files\Storage\IStorageFactory;
|
use OCP\Files\Storage\IStorageFactory;
|
||||||
use OCA\Files_External\Lib\PersonalMount;
|
use OCA\Files_External\Lib\PersonalMount;
|
||||||
use OCP\Files\Config\IMountProvider;
|
use OCP\Files\Config\IMountProvider;
|
||||||
use OCP\IUser;
|
use OCP\IUser;
|
||||||
use OCA\Files_external\Service\UserStoragesService;
|
use OCA\Files_External\Service\UserStoragesService;
|
||||||
use OCA\Files_External\Service\UserGlobalStoragesService;
|
use OCA\Files_External\Service\UserGlobalStoragesService;
|
||||||
use OCA\Files_External\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use OC\Files\Storage\FailedStorage;
|
use OC\Files\Storage\FailedStorage;
|
|
@ -24,18 +24,13 @@
|
||||||
namespace OCA\Files_External\Controller;
|
namespace OCA\Files_External\Controller;
|
||||||
|
|
||||||
|
|
||||||
use \OCP\IConfig;
|
|
||||||
use OCP\ILogger;
|
use OCP\ILogger;
|
||||||
use \OCP\IUserSession;
|
|
||||||
use \OCP\IRequest;
|
use \OCP\IRequest;
|
||||||
use \OCP\IL10N;
|
use \OCP\IL10N;
|
||||||
use \OCP\AppFramework\Http\DataResponse;
|
use \OCP\AppFramework\Http\DataResponse;
|
||||||
use \OCP\AppFramework\Controller;
|
|
||||||
use \OCP\AppFramework\Http;
|
use \OCP\AppFramework\Http;
|
||||||
use \OCA\Files_external\Service\GlobalStoragesService;
|
use OCA\Files_External\Service\GlobalStoragesService;
|
||||||
use \OCA\Files_external\NotFoundException;
|
use OCA\Files_External\NotFoundException;
|
||||||
use \OCA\Files_external\Lib\StorageConfig;
|
|
||||||
use \OCA\Files_External\Service\BackendService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global storages controller
|
* Global storages controller
|
|
@ -25,23 +25,19 @@
|
||||||
namespace OCA\Files_External\Controller;
|
namespace OCA\Files_External\Controller;
|
||||||
|
|
||||||
|
|
||||||
use \OCP\IConfig;
|
|
||||||
use OCP\ILogger;
|
use OCP\ILogger;
|
||||||
use OCP\IUser;
|
|
||||||
use \OCP\IUserSession;
|
|
||||||
use \OCP\IRequest;
|
use \OCP\IRequest;
|
||||||
use \OCP\IL10N;
|
use \OCP\IL10N;
|
||||||
use \OCP\AppFramework\Http\DataResponse;
|
use \OCP\AppFramework\Http\DataResponse;
|
||||||
use \OCP\AppFramework\Controller;
|
use \OCP\AppFramework\Controller;
|
||||||
use \OCP\AppFramework\Http;
|
use \OCP\AppFramework\Http;
|
||||||
use \OCA\Files_external\Service\StoragesService;
|
use OCA\Files_External\Service\StoragesService;
|
||||||
use \OCA\Files_external\NotFoundException;
|
use OCA\Files_External\NotFoundException;
|
||||||
use \OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use \OCA\Files_External\Lib\Backend\Backend;
|
use \OCA\Files_External\Lib\Backend\Backend;
|
||||||
use \OCA\Files_External\Lib\Auth\AuthMechanism;
|
use \OCA\Files_External\Lib\Auth\AuthMechanism;
|
||||||
use \OCP\Files\StorageNotAvailableException;
|
use \OCP\Files\StorageNotAvailableException;
|
||||||
use \OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
|
use \OCA\Files_External\Lib\InsufficientDataForMeaningfulAnswerException;
|
||||||
use \OCA\Files_External\Service\BackendService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for storages controllers
|
* Base class for storages controllers
|
|
@ -30,9 +30,9 @@ use \OCP\IRequest;
|
||||||
use \OCP\IL10N;
|
use \OCP\IL10N;
|
||||||
use \OCP\AppFramework\Http\DataResponse;
|
use \OCP\AppFramework\Http\DataResponse;
|
||||||
use \OCP\AppFramework\Http;
|
use \OCP\AppFramework\Http;
|
||||||
use \OCA\Files_external\Service\UserGlobalStoragesService;
|
use OCA\Files_External\Service\UserGlobalStoragesService;
|
||||||
use \OCA\Files_external\NotFoundException;
|
use OCA\Files_External\NotFoundException;
|
||||||
use \OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use \OCA\Files_External\Lib\Backend\Backend;
|
use \OCA\Files_External\Lib\Backend\Backend;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
|
|
|
@ -25,19 +25,15 @@ namespace OCA\Files_External\Controller;
|
||||||
|
|
||||||
|
|
||||||
use OCA\Files_External\Lib\Auth\AuthMechanism;
|
use OCA\Files_External\Lib\Auth\AuthMechanism;
|
||||||
use \OCP\IConfig;
|
|
||||||
use OCP\ILogger;
|
use OCP\ILogger;
|
||||||
use OCP\IUser;
|
|
||||||
use \OCP\IUserSession;
|
use \OCP\IUserSession;
|
||||||
use \OCP\IRequest;
|
use \OCP\IRequest;
|
||||||
use \OCP\IL10N;
|
use \OCP\IL10N;
|
||||||
use \OCP\AppFramework\Http\DataResponse;
|
use \OCP\AppFramework\Http\DataResponse;
|
||||||
use \OCP\AppFramework\Controller;
|
|
||||||
use \OCP\AppFramework\Http;
|
use \OCP\AppFramework\Http;
|
||||||
use \OCA\Files_external\Service\UserStoragesService;
|
use OCA\Files_External\Service\UserStoragesService;
|
||||||
use \OCA\Files_External\Service\BackendService;
|
use OCA\Files_External\NotFoundException;
|
||||||
use \OCA\Files_external\NotFoundException;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use \OCA\Files_external\Lib\StorageConfig;
|
|
||||||
use \OCA\Files_External\Lib\Backend\Backend;
|
use \OCA\Files_External\Lib\Backend\Backend;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -22,8 +22,6 @@
|
||||||
namespace OCA\Files_External\Lib\Auth;
|
namespace OCA\Files_External\Lib\Auth;
|
||||||
|
|
||||||
use \OCP\IL10N;
|
use \OCP\IL10N;
|
||||||
use \OCA\Files_External\Lib\Auth\AuthMechanism;
|
|
||||||
use \OCA\Files_external\Lib\StorageConfig;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builtin authentication mechanism, for legacy backends
|
* Builtin authentication mechanism, for legacy backends
|
|
@ -22,8 +22,6 @@
|
||||||
namespace OCA\Files_External\Lib\Auth;
|
namespace OCA\Files_External\Lib\Auth;
|
||||||
|
|
||||||
use \OCP\IL10N;
|
use \OCP\IL10N;
|
||||||
use \OCA\Files_External\Lib\Auth\AuthMechanism;
|
|
||||||
use \OCA\Files_external\Lib\StorageConfig;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Null authentication mechanism
|
* Null authentication mechanism
|
|
@ -23,7 +23,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Files_external\Lib;
|
namespace OCA\Files_External\Lib;
|
||||||
|
|
||||||
use OCA\Files_External\Lib\Auth\IUserProvided;
|
use OCA\Files_External\Lib\Auth\IUserProvided;
|
||||||
use \OCA\Files_External\Lib\Backend\Backend;
|
use \OCA\Files_External\Lib\Backend\Backend;
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Files_external\Migration;
|
namespace OCA\Files_External\Migration;
|
||||||
|
|
||||||
use OCP\IUser;
|
use OCP\IUser;
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
|
@ -20,22 +20,21 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Files_external\Migration;
|
namespace OCA\Files_External\Migration;
|
||||||
|
|
||||||
use OCA\Files_External\Service\BackendService;
|
use OCA\Files_External\Service\BackendService;
|
||||||
use OCA\Files_External\Service\DBConfigService;
|
use OCA\Files_External\Service\DBConfigService;
|
||||||
use OCA\Files_external\Service\GlobalLegacyStoragesService;
|
use OCA\Files_External\Service\GlobalLegacyStoragesService;
|
||||||
use OCA\Files_external\Service\GlobalStoragesService;
|
use OCA\Files_External\Service\GlobalStoragesService;
|
||||||
use OCA\Files_external\Service\LegacyStoragesService;
|
use OCA\Files_External\Service\LegacyStoragesService;
|
||||||
use OCA\Files_external\Service\StoragesService;
|
use OCA\Files_External\Service\StoragesService;
|
||||||
use OCA\Files_external\Service\UserLegacyStoragesService;
|
use OCA\Files_External\Service\UserLegacyStoragesService;
|
||||||
use OCA\Files_external\Service\UserStoragesService;
|
use OCA\Files_External\Service\UserStoragesService;
|
||||||
use OCP\Files\Config\IUserMountCache;
|
use OCP\Files\Config\IUserMountCache;
|
||||||
use OCP\IConfig;
|
use OCP\IConfig;
|
||||||
use OCP\IDBConnection;
|
use OCP\IDBConnection;
|
||||||
use OCP\ILogger;
|
use OCP\ILogger;
|
||||||
use OCP\IUser;
|
use OCP\IUser;
|
||||||
use OCP\IUserSession;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Migrate mount config from mount.json to the database
|
* Migrate mount config from mount.json to the database
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Files_external;
|
namespace OCA\Files_External;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Storage is not found
|
* Storage is not found
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Files_external\Service;
|
namespace OCA\Files_External\Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read admin defined mounts from the legacy mount.json
|
* Read admin defined mounts from the legacy mount.json
|
|
@ -22,13 +22,11 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Files_external\Service;
|
namespace OCA\Files_External\Service;
|
||||||
|
|
||||||
|
|
||||||
use \OCP\IUserSession;
|
|
||||||
use \OC\Files\Filesystem;
|
use \OC\Files\Filesystem;
|
||||||
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use \OCA\Files_external\Lib\StorageConfig;
|
|
||||||
use \OCA\Files_external\NotFoundException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service class to manage global external storages
|
* Service class to manage global external storages
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Files_external\Service;
|
namespace OCA\Files_External\Service;
|
||||||
|
|
||||||
class ImportLegacyStoragesService extends LegacyStoragesService {
|
class ImportLegacyStoragesService extends LegacyStoragesService {
|
||||||
private $data;
|
private $data;
|
|
@ -19,9 +19,9 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Files_external\Service;
|
namespace OCA\Files_External\Service;
|
||||||
|
|
||||||
use \OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read mount config from legacy mount.json
|
* Read mount config from legacy mount.json
|
|
@ -23,11 +23,11 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Files_external\Service;
|
namespace OCA\Files_External\Service;
|
||||||
|
|
||||||
use \OC\Files\Filesystem;
|
use \OC\Files\Filesystem;
|
||||||
use \OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use \OCA\Files_external\NotFoundException;
|
use OCA\Files_External\NotFoundException;
|
||||||
use \OCA\Files_External\Lib\Backend\Backend;
|
use \OCA\Files_External\Lib\Backend\Backend;
|
||||||
use \OCA\Files_External\Lib\Auth\AuthMechanism;
|
use \OCA\Files_External\Lib\Auth\AuthMechanism;
|
||||||
use OCP\Files\Config\IUserMountCache;
|
use OCP\Files\Config\IUserMountCache;
|
|
@ -22,12 +22,9 @@
|
||||||
|
|
||||||
namespace OCA\Files_External\Service;
|
namespace OCA\Files_External\Service;
|
||||||
|
|
||||||
use \OCA\Files_external\Service\GlobalStoragesService;
|
|
||||||
use \OCA\Files_External\Service\BackendService;
|
|
||||||
use OCP\Files\Config\IUserMountCache;
|
use OCP\Files\Config\IUserMountCache;
|
||||||
use \OCP\IUserSession;
|
use \OCP\IUserSession;
|
||||||
use \OCP\IGroupManager;
|
use \OCP\IGroupManager;
|
||||||
use \OCA\Files_External\Service\UserTrait;
|
|
||||||
use \OCA\Files_External\Lib\StorageConfig;
|
use \OCA\Files_External\Lib\StorageConfig;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -19,7 +19,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Files_external\Service;
|
namespace OCA\Files_External\Service;
|
||||||
|
|
||||||
use OCP\IUserSession;
|
use OCP\IUserSession;
|
||||||
|
|
|
@ -21,14 +21,14 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCA\Files_external\Service;
|
namespace OCA\Files_External\Service;
|
||||||
|
|
||||||
use OCP\Files\Config\IUserMountCache;
|
use OCP\Files\Config\IUserMountCache;
|
||||||
use \OCP\IUserSession;
|
use \OCP\IUserSession;
|
||||||
use \OC\Files\Filesystem;
|
use \OC\Files\Filesystem;
|
||||||
|
|
||||||
use \OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use \OCA\Files_external\NotFoundException;
|
use OCA\Files_External\NotFoundException;
|
||||||
use \OCA\Files_External\Service\BackendService;
|
use \OCA\Files_External\Service\BackendService;
|
||||||
use \OCA\Files_External\Service\UserTrait;
|
use \OCA\Files_External\Service\UserTrait;
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use phpseclib\Crypt\AES;
|
use phpseclib\Crypt\AES;
|
||||||
use \OCA\Files_External\Appinfo\Application;
|
use \OCA\Files_External\AppInfo\Application;
|
||||||
use \OCA\Files_External\Lib\Backend\LegacyBackend;
|
use \OCA\Files_External\Lib\Backend\LegacyBackend;
|
||||||
use \OCA\Files_External\Lib\StorageConfig;
|
use \OCA\Files_External\Lib\StorageConfig;
|
||||||
use \OCA\Files_External\Lib\Backend\Backend;
|
use \OCA\Files_External\Lib\Backend\Backend;
|
||||||
|
@ -91,7 +91,7 @@ class OC_Mount_Config {
|
||||||
$userStoragesService->setUser($user);
|
$userStoragesService->setUser($user);
|
||||||
|
|
||||||
foreach ($userGlobalStoragesService->getStorages() as $storage) {
|
foreach ($userGlobalStoragesService->getStorages() as $storage) {
|
||||||
/** @var \OCA\Files_external\Lib\StorageConfig $storage */
|
/** @var \OCA\Files_External\Lib\StorageConfig $storage */
|
||||||
$mountPoint = '/'.$uid.'/files'.$storage->getMountPoint();
|
$mountPoint = '/'.$uid.'/files'.$storage->getMountPoint();
|
||||||
$mountEntry = self::prepareMountPointEntry($storage, false);
|
$mountEntry = self::prepareMountPointEntry($storage, false);
|
||||||
foreach ($mountEntry['options'] as &$option) {
|
foreach ($mountEntry['options'] as &$option) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ use \OCA\Files_External\Service\BackendService;
|
||||||
// we must use the same container
|
// we must use the same container
|
||||||
$appContainer = \OC_Mount_Config::$app->getContainer();
|
$appContainer = \OC_Mount_Config::$app->getContainer();
|
||||||
$backendService = $appContainer->query('OCA\Files_External\Service\BackendService');
|
$backendService = $appContainer->query('OCA\Files_External\Service\BackendService');
|
||||||
$userStoragesService = $appContainer->query('OCA\Files_external\Service\UserStoragesService');
|
$userStoragesService = $appContainer->query('OCA\Files_External\Service\UserStoragesService');
|
||||||
|
|
||||||
$tmpl = new OCP\Template('files_external', 'settings');
|
$tmpl = new OCP\Template('files_external', 'settings');
|
||||||
$tmpl->assign('encryptionEnabled', \OC::$server->getEncryptionManager()->isEnabled());
|
$tmpl->assign('encryptionEnabled', \OC::$server->getEncryptionManager()->isEnabled());
|
||||||
|
|
|
@ -31,7 +31,7 @@ use \OCA\Files_External\Service\BackendService;
|
||||||
// we must use the same container
|
// we must use the same container
|
||||||
$appContainer = \OC_Mount_Config::$app->getContainer();
|
$appContainer = \OC_Mount_Config::$app->getContainer();
|
||||||
$backendService = $appContainer->query('OCA\Files_External\Service\BackendService');
|
$backendService = $appContainer->query('OCA\Files_External\Service\BackendService');
|
||||||
$globalStoragesService = $appContainer->query('OCA\Files_external\Service\GlobalStoragesService');
|
$globalStoragesService = $appContainer->query('OCA\Files_External\Service\GlobalStoragesService');
|
||||||
|
|
||||||
\OC_Util::addVendorScript('select2/select2');
|
\OC_Util::addVendorScript('select2/select2');
|
||||||
\OC_Util::addVendorStyle('select2/select2');
|
\OC_Util::addVendorStyle('select2/select2');
|
||||||
|
|
|
@ -35,7 +35,7 @@ use OCA\Files_External\Lib\Storage\AmazonS3;
|
||||||
*
|
*
|
||||||
* @package OCA\Files_External\Tests
|
* @package OCA\Files_External\Tests
|
||||||
*/
|
*/
|
||||||
class AmazonS3Migration extends \Test\TestCase {
|
class AmazonS3MigrationTest extends \Test\TestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \OC\Files\Storage\Storage instance
|
* @var \OC\Files\Storage\Storage instance
|
|
@ -21,8 +21,8 @@
|
||||||
|
|
||||||
namespace OCA\Files_External\Tests\Command;
|
namespace OCA\Files_External\Tests\Command;
|
||||||
|
|
||||||
use OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use OCA\Files_external\NotFoundException;
|
use OCA\Files_External\NotFoundException;
|
||||||
use Symfony\Component\Console\Command\Command;
|
use Symfony\Component\Console\Command\Command;
|
||||||
use Symfony\Component\Console\Input\ArrayInput;
|
use Symfony\Component\Console\Input\ArrayInput;
|
||||||
use Symfony\Component\Console\Input\Input;
|
use Symfony\Component\Console\Input\Input;
|
||||||
|
@ -32,10 +32,10 @@ use Test\TestCase;
|
||||||
abstract class CommandTest extends TestCase {
|
abstract class CommandTest extends TestCase {
|
||||||
/**
|
/**
|
||||||
* @param StorageConfig[] $mounts
|
* @param StorageConfig[] $mounts
|
||||||
* @return \OCA\Files_external\Service\GlobalStoragesService|\PHPUnit_Framework_MockObject_MockObject
|
* @return \OCA\Files_External\Service\GlobalStoragesService|\PHPUnit_Framework_MockObject_MockObject
|
||||||
*/
|
*/
|
||||||
protected function getGlobalStorageService(array $mounts = []) {
|
protected function getGlobalStorageService(array $mounts = []) {
|
||||||
$mock = $this->getMockBuilder('OCA\Files_external\Service\GlobalStoragesService')
|
$mock = $this->getMockBuilder('OCA\Files_External\Service\GlobalStoragesService')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
|
@ -26,7 +26,7 @@ use OCA\Files_External\Lib\Auth\NullMechanism;
|
||||||
use OCA\Files_External\Lib\Auth\Password\Password;
|
use OCA\Files_External\Lib\Auth\Password\Password;
|
||||||
use OCA\Files_External\Lib\Auth\Password\SessionCredentials;
|
use OCA\Files_External\Lib\Auth\Password\SessionCredentials;
|
||||||
use OCA\Files_External\Lib\Backend\Local;
|
use OCA\Files_External\Lib\Backend\Local;
|
||||||
use OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use Symfony\Component\Console\Output\BufferedOutput;
|
use Symfony\Component\Console\Output\BufferedOutput;
|
||||||
|
|
||||||
class ListCommandTest extends CommandTest {
|
class ListCommandTest extends CommandTest {
|
||||||
|
@ -34,10 +34,10 @@ class ListCommandTest extends CommandTest {
|
||||||
* @return \OCA\Files_External\Command\ListCommand|\PHPUnit_Framework_MockObject_MockObject
|
* @return \OCA\Files_External\Command\ListCommand|\PHPUnit_Framework_MockObject_MockObject
|
||||||
*/
|
*/
|
||||||
private function getInstance() {
|
private function getInstance() {
|
||||||
/** @var \OCA\Files_external\Service\GlobalStoragesService|\PHPUnit_Framework_MockObject_MockObject $globalService */
|
/** @var \OCA\Files_External\Service\GlobalStoragesService|\PHPUnit_Framework_MockObject_MockObject $globalService */
|
||||||
$globalService = $this->getMock('\OCA\Files_external\Service\GlobalStoragesService', null, [], '', false);
|
$globalService = $this->getMock('\OCA\Files_External\Service\GlobalStoragesService', null, [], '', false);
|
||||||
/** @var \OCA\Files_external\Service\UserStoragesService|\PHPUnit_Framework_MockObject_MockObject $userService */
|
/** @var \OCA\Files_External\Service\UserStoragesService|\PHPUnit_Framework_MockObject_MockObject $userService */
|
||||||
$userService = $this->getMock('\OCA\Files_external\Service\UserStoragesService', null, [], '', false);
|
$userService = $this->getMock('\OCA\Files_External\Service\UserStoragesService', null, [], '', false);
|
||||||
/** @var \OCP\IUserManager|\PHPUnit_Framework_MockObject_MockObject $userManager */
|
/** @var \OCP\IUserManager|\PHPUnit_Framework_MockObject_MockObject $userManager */
|
||||||
$userManager = $this->getMock('\OCP\IUserManager');
|
$userManager = $this->getMock('\OCP\IUserManager');
|
||||||
/** @var \OCP\IUserSession|\PHPUnit_Framework_MockObject_MockObject $userSession */
|
/** @var \OCP\IUserSession|\PHPUnit_Framework_MockObject_MockObject $userSession */
|
|
@ -20,18 +20,16 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
namespace OCA\Files_external\Tests\Controller;
|
namespace OCA\Files_External\Tests\Controller;
|
||||||
|
|
||||||
use \OCA\Files_external\Controller\GlobalStoragesController;
|
use OCA\Files_External\Controller\GlobalStoragesController;
|
||||||
use \OCA\Files_external\Service\GlobalStoragesService;
|
|
||||||
use \OCP\AppFramework\Http;
|
use \OCP\AppFramework\Http;
|
||||||
use \OCA\Files_external\NotFoundException;
|
|
||||||
use \OCA\Files_External\Service\BackendService;
|
use \OCA\Files_External\Service\BackendService;
|
||||||
|
|
||||||
class GlobalStoragesControllerTest extends StoragesControllerTest {
|
class GlobalStoragesControllerTest extends StoragesControllerTest {
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->service = $this->getMockBuilder('\OCA\Files_external\Service\GlobalStoragesService')
|
$this->service = $this->getMockBuilder('\OCA\Files_External\Service\GlobalStoragesService')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
|
@ -19,14 +19,14 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
namespace OCA\Files_external\Tests\Controller;
|
namespace OCA\Files_External\Tests\Controller;
|
||||||
|
|
||||||
use \OCP\AppFramework\Http;
|
use \OCP\AppFramework\Http;
|
||||||
|
|
||||||
use \OCA\Files_external\Controller\GlobalStoragesController;
|
use \OCA\Files_External\Controller\GlobalStoragesController;
|
||||||
use \OCA\Files_external\Service\GlobalStoragesService;
|
use \OCA\Files_External\Service\GlobalStoragesService;
|
||||||
use \OCA\Files_external\Lib\StorageConfig;
|
use OCA\Files_External\Lib\StorageConfig;
|
||||||
use \OCA\Files_external\NotFoundException;
|
use OCA\Files_External\NotFoundException;
|
||||||
|
|
||||||
abstract class StoragesControllerTest extends \Test\TestCase {
|
abstract class StoragesControllerTest extends \Test\TestCase {
|
||||||
|
|
|
@ -20,13 +20,10 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
namespace OCA\Files_external\Tests\Controller;
|
namespace OCA\Files_External\Tests\Controller;
|
||||||
|
|
||||||
use \OCA\Files_external\Controller\UserStoragesController;
|
use \OCA\Files_External\Controller\UserStoragesController;
|
||||||
use \OCA\Files_external\Service\UserStoragesService;
|
|
||||||
use \OCP\AppFramework\Http;
|
use \OCP\AppFramework\Http;
|
||||||
use \OCA\Files_external\NotFoundException;
|
|
||||||
use \OCA\Files_External\Lib\StorageConfig;
|
|
||||||
use \OCA\Files_External\Service\BackendService;
|
use \OCA\Files_External\Service\BackendService;
|
||||||
|
|
||||||
class UserStoragesControllerTest extends StoragesControllerTest {
|
class UserStoragesControllerTest extends StoragesControllerTest {
|
||||||
|
@ -38,7 +35,7 @@ class UserStoragesControllerTest extends StoragesControllerTest {
|
||||||
|
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->service = $this->getMockBuilder('\OCA\Files_external\Service\UserStoragesService')
|
$this->service = $this->getMockBuilder('\OCA\Files_External\Service\UserStoragesService')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue