@@ -40,24 +40,24 @@ |
||
40 | 40 | interface IProviderService { |
41 | 41 | |
42 | 42 | |
43 | - /** |
|
44 | - * Check if the provider $providerId is already indexed. |
|
45 | - * |
|
46 | - * @since 15.0.0 |
|
47 | - * |
|
48 | - * @param string $providerId |
|
49 | - * |
|
50 | - * @return bool |
|
51 | - */ |
|
52 | - public function isProviderIndexed(string $providerId); |
|
53 | - |
|
54 | - |
|
55 | - /** |
|
56 | - * Add the Javascript API in the navigation page of an app. |
|
57 | - * |
|
58 | - * @since 15.0.0 |
|
59 | - */ |
|
60 | - public function addJavascriptAPI(); |
|
43 | + /** |
|
44 | + * Check if the provider $providerId is already indexed. |
|
45 | + * |
|
46 | + * @since 15.0.0 |
|
47 | + * |
|
48 | + * @param string $providerId |
|
49 | + * |
|
50 | + * @return bool |
|
51 | + */ |
|
52 | + public function isProviderIndexed(string $providerId); |
|
53 | + |
|
54 | + |
|
55 | + /** |
|
56 | + * Add the Javascript API in the navigation page of an app. |
|
57 | + * |
|
58 | + * @since 15.0.0 |
|
59 | + */ |
|
60 | + public function addJavascriptAPI(); |
|
61 | 61 | |
62 | 62 | |
63 | 63 | } |
@@ -26,23 +26,23 @@ |
||
26 | 26 | use OCP\IUser; |
27 | 27 | |
28 | 28 | class CachedMountFileInfo extends CachedMountInfo implements ICachedMountFileInfo { |
29 | - /** @var string */ |
|
30 | - private $internalPath; |
|
29 | + /** @var string */ |
|
30 | + private $internalPath; |
|
31 | 31 | |
32 | - public function __construct(IUser $user, $storageId, $rootId, $mountPoint, $mountId = null, $rootInternalPath = '', $internalPath) { |
|
33 | - parent::__construct($user, $storageId, $rootId, $mountPoint, $mountId, $rootInternalPath); |
|
34 | - $this->internalPath = $internalPath; |
|
35 | - } |
|
32 | + public function __construct(IUser $user, $storageId, $rootId, $mountPoint, $mountId = null, $rootInternalPath = '', $internalPath) { |
|
33 | + parent::__construct($user, $storageId, $rootId, $mountPoint, $mountId, $rootInternalPath); |
|
34 | + $this->internalPath = $internalPath; |
|
35 | + } |
|
36 | 36 | |
37 | - public function getInternalPath() { |
|
38 | - if ($this->getRootInternalPath()) { |
|
39 | - return substr($this->internalPath, strlen($this->getRootInternalPath()) + 1); |
|
40 | - } else { |
|
41 | - return $this->internalPath; |
|
42 | - } |
|
43 | - } |
|
37 | + public function getInternalPath() { |
|
38 | + if ($this->getRootInternalPath()) { |
|
39 | + return substr($this->internalPath, strlen($this->getRootInternalPath()) + 1); |
|
40 | + } else { |
|
41 | + return $this->internalPath; |
|
42 | + } |
|
43 | + } |
|
44 | 44 | |
45 | - public function getPath() { |
|
46 | - return $this->getMountPoint() . $this->getInternalPath(); |
|
47 | - } |
|
45 | + public function getPath() { |
|
46 | + return $this->getMountPoint() . $this->getInternalPath(); |
|
47 | + } |
|
48 | 48 | } |
@@ -30,50 +30,50 @@ |
||
30 | 30 | use OCP\ILogger; |
31 | 31 | |
32 | 32 | class SVG extends ProviderV2 { |
33 | - /** |
|
34 | - * {@inheritDoc} |
|
35 | - */ |
|
36 | - public function getMimeType(): string { |
|
37 | - return '/image\/svg\+xml/'; |
|
38 | - } |
|
33 | + /** |
|
34 | + * {@inheritDoc} |
|
35 | + */ |
|
36 | + public function getMimeType(): string { |
|
37 | + return '/image\/svg\+xml/'; |
|
38 | + } |
|
39 | 39 | |
40 | - /** |
|
41 | - * {@inheritDoc} |
|
42 | - */ |
|
43 | - public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { |
|
44 | - try { |
|
45 | - $svg = new \Imagick(); |
|
46 | - $svg->setBackgroundColor(new \ImagickPixel('transparent')); |
|
40 | + /** |
|
41 | + * {@inheritDoc} |
|
42 | + */ |
|
43 | + public function getThumbnail(File $file, int $maxX, int $maxY): ?IImage { |
|
44 | + try { |
|
45 | + $svg = new \Imagick(); |
|
46 | + $svg->setBackgroundColor(new \ImagickPixel('transparent')); |
|
47 | 47 | |
48 | - $content = stream_get_contents($file->fopen('r')); |
|
49 | - if (substr($content, 0, 5) !== '<?xml') { |
|
50 | - $content = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' . $content; |
|
51 | - } |
|
48 | + $content = stream_get_contents($file->fopen('r')); |
|
49 | + if (substr($content, 0, 5) !== '<?xml') { |
|
50 | + $content = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' . $content; |
|
51 | + } |
|
52 | 52 | |
53 | - // Do not parse SVG files with references |
|
54 | - if (stripos($content, 'xlink:href') !== false) { |
|
55 | - return null; |
|
56 | - } |
|
53 | + // Do not parse SVG files with references |
|
54 | + if (stripos($content, 'xlink:href') !== false) { |
|
55 | + return null; |
|
56 | + } |
|
57 | 57 | |
58 | - $svg->readImageBlob($content); |
|
59 | - $svg->setImageFormat('png32'); |
|
60 | - } catch (\Exception $e) { |
|
61 | - \OC::$server->getLogger()->logException($e, [ |
|
62 | - 'level' => ILogger::ERROR, |
|
63 | - 'app' => 'core', |
|
64 | - ]); |
|
65 | - return null; |
|
66 | - } |
|
58 | + $svg->readImageBlob($content); |
|
59 | + $svg->setImageFormat('png32'); |
|
60 | + } catch (\Exception $e) { |
|
61 | + \OC::$server->getLogger()->logException($e, [ |
|
62 | + 'level' => ILogger::ERROR, |
|
63 | + 'app' => 'core', |
|
64 | + ]); |
|
65 | + return null; |
|
66 | + } |
|
67 | 67 | |
68 | - //new image object |
|
69 | - $image = new \OC_Image(); |
|
70 | - $image->loadFromData($svg); |
|
71 | - //check if image object is valid |
|
72 | - if ($image->valid()) { |
|
73 | - $image->scaleDownToFit($maxX, $maxY); |
|
68 | + //new image object |
|
69 | + $image = new \OC_Image(); |
|
70 | + $image->loadFromData($svg); |
|
71 | + //check if image object is valid |
|
72 | + if ($image->valid()) { |
|
73 | + $image->scaleDownToFit($maxX, $maxY); |
|
74 | 74 | |
75 | - return $image; |
|
76 | - } |
|
77 | - return null; |
|
78 | - } |
|
75 | + return $image; |
|
76 | + } |
|
77 | + return null; |
|
78 | + } |
|
79 | 79 | } |
@@ -29,21 +29,21 @@ |
||
29 | 29 | use OC\AppFramework\DependencyInjection\DIContainer; |
30 | 30 | |
31 | 31 | class RouteActionHandler { |
32 | - private $controllerName; |
|
33 | - private $actionName; |
|
34 | - private $container; |
|
32 | + private $controllerName; |
|
33 | + private $actionName; |
|
34 | + private $container; |
|
35 | 35 | |
36 | - /** |
|
37 | - * @param string $controllerName |
|
38 | - * @param string $actionName |
|
39 | - */ |
|
40 | - public function __construct(DIContainer $container, $controllerName, $actionName) { |
|
41 | - $this->controllerName = $controllerName; |
|
42 | - $this->actionName = $actionName; |
|
43 | - $this->container = $container; |
|
44 | - } |
|
36 | + /** |
|
37 | + * @param string $controllerName |
|
38 | + * @param string $actionName |
|
39 | + */ |
|
40 | + public function __construct(DIContainer $container, $controllerName, $actionName) { |
|
41 | + $this->controllerName = $controllerName; |
|
42 | + $this->actionName = $actionName; |
|
43 | + $this->container = $container; |
|
44 | + } |
|
45 | 45 | |
46 | - public function __invoke($params) { |
|
47 | - App::main($this->controllerName, $this->actionName, $this->container, $params); |
|
48 | - } |
|
46 | + public function __invoke($params) { |
|
47 | + App::main($this->controllerName, $this->actionName, $this->container, $params); |
|
48 | + } |
|
49 | 49 | } |
@@ -30,25 +30,25 @@ |
||
30 | 30 | |
31 | 31 | class PreLoginHookCommand extends ALoginCommand { |
32 | 32 | |
33 | - /** @var IUserManager */ |
|
34 | - private $userManager; |
|
35 | - |
|
36 | - public function __construct(IUserManager $userManager) { |
|
37 | - $this->userManager = $userManager; |
|
38 | - } |
|
39 | - |
|
40 | - public function process(LoginData $loginData): LoginResult { |
|
41 | - if ($this->userManager instanceof PublicEmitter) { |
|
42 | - $this->userManager->emit( |
|
43 | - '\OC\User', |
|
44 | - 'preLogin', |
|
45 | - [ |
|
46 | - $loginData->getUsername(), |
|
47 | - $loginData->getPassword(), |
|
48 | - ] |
|
49 | - ); |
|
50 | - } |
|
51 | - |
|
52 | - return $this->processNextOrFinishSuccessfully($loginData); |
|
53 | - } |
|
33 | + /** @var IUserManager */ |
|
34 | + private $userManager; |
|
35 | + |
|
36 | + public function __construct(IUserManager $userManager) { |
|
37 | + $this->userManager = $userManager; |
|
38 | + } |
|
39 | + |
|
40 | + public function process(LoginData $loginData): LoginResult { |
|
41 | + if ($this->userManager instanceof PublicEmitter) { |
|
42 | + $this->userManager->emit( |
|
43 | + '\OC\User', |
|
44 | + 'preLogin', |
|
45 | + [ |
|
46 | + $loginData->getUsername(), |
|
47 | + $loginData->getPassword(), |
|
48 | + ] |
|
49 | + ); |
|
50 | + } |
|
51 | + |
|
52 | + return $this->processNextOrFinishSuccessfully($loginData); |
|
53 | + } |
|
54 | 54 | } |
@@ -29,28 +29,28 @@ |
||
29 | 29 | |
30 | 30 | class RootCollection extends AbstractPrincipalCollection { |
31 | 31 | |
32 | - /** @var CleanupService */ |
|
33 | - private $cleanupService; |
|
34 | - |
|
35 | - public function __construct(PrincipalBackend\BackendInterface $principalBackend, |
|
36 | - string $principalPrefix, |
|
37 | - CleanupService $cleanupService) { |
|
38 | - parent::__construct($principalBackend, $principalPrefix); |
|
39 | - $this->cleanupService = $cleanupService; |
|
40 | - } |
|
41 | - |
|
42 | - /** |
|
43 | - * @inheritdoc |
|
44 | - */ |
|
45 | - public function getChildForPrincipal(array $principalInfo): UploadHome { |
|
46 | - return new UploadHome($principalInfo, $this->cleanupService); |
|
47 | - } |
|
48 | - |
|
49 | - /** |
|
50 | - * @inheritdoc |
|
51 | - */ |
|
52 | - public function getName(): string { |
|
53 | - return 'uploads'; |
|
54 | - } |
|
32 | + /** @var CleanupService */ |
|
33 | + private $cleanupService; |
|
34 | + |
|
35 | + public function __construct(PrincipalBackend\BackendInterface $principalBackend, |
|
36 | + string $principalPrefix, |
|
37 | + CleanupService $cleanupService) { |
|
38 | + parent::__construct($principalBackend, $principalPrefix); |
|
39 | + $this->cleanupService = $cleanupService; |
|
40 | + } |
|
41 | + |
|
42 | + /** |
|
43 | + * @inheritdoc |
|
44 | + */ |
|
45 | + public function getChildForPrincipal(array $principalInfo): UploadHome { |
|
46 | + return new UploadHome($principalInfo, $this->cleanupService); |
|
47 | + } |
|
48 | + |
|
49 | + /** |
|
50 | + * @inheritdoc |
|
51 | + */ |
|
52 | + public function getName(): string { |
|
53 | + return 'uploads'; |
|
54 | + } |
|
55 | 55 | |
56 | 56 | } |
@@ -30,48 +30,48 @@ |
||
30 | 30 | use Sabre\DAV\INode; |
31 | 31 | |
32 | 32 | class RestoreFolder implements ICollection, IMoveTarget { |
33 | - public function createFile($name, $data = null) { |
|
34 | - throw new Forbidden(); |
|
35 | - } |
|
33 | + public function createFile($name, $data = null) { |
|
34 | + throw new Forbidden(); |
|
35 | + } |
|
36 | 36 | |
37 | - public function createDirectory($name) { |
|
38 | - throw new Forbidden(); |
|
39 | - } |
|
37 | + public function createDirectory($name) { |
|
38 | + throw new Forbidden(); |
|
39 | + } |
|
40 | 40 | |
41 | - public function getChild($name) { |
|
42 | - return null; |
|
43 | - } |
|
41 | + public function getChild($name) { |
|
42 | + return null; |
|
43 | + } |
|
44 | 44 | |
45 | - public function delete() { |
|
46 | - throw new Forbidden(); |
|
47 | - } |
|
45 | + public function delete() { |
|
46 | + throw new Forbidden(); |
|
47 | + } |
|
48 | 48 | |
49 | - public function getName() { |
|
50 | - return 'restore'; |
|
51 | - } |
|
49 | + public function getName() { |
|
50 | + return 'restore'; |
|
51 | + } |
|
52 | 52 | |
53 | - public function setName($name) { |
|
54 | - throw new Forbidden(); |
|
55 | - } |
|
53 | + public function setName($name) { |
|
54 | + throw new Forbidden(); |
|
55 | + } |
|
56 | 56 | |
57 | - public function getLastModified(): int { |
|
58 | - return 0; |
|
59 | - } |
|
57 | + public function getLastModified(): int { |
|
58 | + return 0; |
|
59 | + } |
|
60 | 60 | |
61 | - public function getChildren(): array { |
|
62 | - return []; |
|
63 | - } |
|
61 | + public function getChildren(): array { |
|
62 | + return []; |
|
63 | + } |
|
64 | 64 | |
65 | - public function childExists($name): bool { |
|
66 | - return false; |
|
67 | - } |
|
65 | + public function childExists($name): bool { |
|
66 | + return false; |
|
67 | + } |
|
68 | 68 | |
69 | - public function moveInto($targetName, $sourcePath, INode $sourceNode): bool { |
|
70 | - if (!($sourceNode instanceof ITrash)) { |
|
71 | - return false; |
|
72 | - } |
|
69 | + public function moveInto($targetName, $sourcePath, INode $sourceNode): bool { |
|
70 | + if (!($sourceNode instanceof ITrash)) { |
|
71 | + return false; |
|
72 | + } |
|
73 | 73 | |
74 | - return $sourceNode->restore(); |
|
75 | - } |
|
74 | + return $sourceNode->restore(); |
|
75 | + } |
|
76 | 76 | |
77 | 77 | } |
@@ -31,49 +31,49 @@ |
||
31 | 31 | use Sabre\DAV\INode; |
32 | 32 | |
33 | 33 | class RestoreFolder implements ICollection, IMoveTarget { |
34 | - public function createFile($name, $data = null) { |
|
35 | - throw new Forbidden(); |
|
36 | - } |
|
34 | + public function createFile($name, $data = null) { |
|
35 | + throw new Forbidden(); |
|
36 | + } |
|
37 | 37 | |
38 | - public function createDirectory($name) { |
|
39 | - throw new Forbidden(); |
|
40 | - } |
|
38 | + public function createDirectory($name) { |
|
39 | + throw new Forbidden(); |
|
40 | + } |
|
41 | 41 | |
42 | - public function getChild($name) { |
|
43 | - return null; |
|
44 | - } |
|
42 | + public function getChild($name) { |
|
43 | + return null; |
|
44 | + } |
|
45 | 45 | |
46 | - public function delete() { |
|
47 | - throw new Forbidden(); |
|
48 | - } |
|
46 | + public function delete() { |
|
47 | + throw new Forbidden(); |
|
48 | + } |
|
49 | 49 | |
50 | - public function getName() { |
|
51 | - return 'restore'; |
|
52 | - } |
|
50 | + public function getName() { |
|
51 | + return 'restore'; |
|
52 | + } |
|
53 | 53 | |
54 | - public function setName($name) { |
|
55 | - throw new Forbidden(); |
|
56 | - } |
|
54 | + public function setName($name) { |
|
55 | + throw new Forbidden(); |
|
56 | + } |
|
57 | 57 | |
58 | - public function getLastModified(): int { |
|
59 | - return 0; |
|
60 | - } |
|
58 | + public function getLastModified(): int { |
|
59 | + return 0; |
|
60 | + } |
|
61 | 61 | |
62 | - public function getChildren(): array { |
|
63 | - return []; |
|
64 | - } |
|
62 | + public function getChildren(): array { |
|
63 | + return []; |
|
64 | + } |
|
65 | 65 | |
66 | - public function childExists($name): bool { |
|
67 | - return false; |
|
68 | - } |
|
66 | + public function childExists($name): bool { |
|
67 | + return false; |
|
68 | + } |
|
69 | 69 | |
70 | - public function moveInto($targetName, $sourcePath, INode $sourceNode): bool { |
|
71 | - if (!($sourceNode instanceof VersionFile)) { |
|
72 | - return false; |
|
73 | - } |
|
70 | + public function moveInto($targetName, $sourcePath, INode $sourceNode): bool { |
|
71 | + if (!($sourceNode instanceof VersionFile)) { |
|
72 | + return false; |
|
73 | + } |
|
74 | 74 | |
75 | - $sourceNode->rollBack(); |
|
76 | - return true; |
|
77 | - } |
|
75 | + $sourceNode->rollBack(); |
|
76 | + return true; |
|
77 | + } |
|
78 | 78 | |
79 | 79 | } |
@@ -33,26 +33,26 @@ |
||
33 | 33 | */ |
34 | 34 | class Config { |
35 | 35 | |
36 | - /** @var ICloudFederationProviderManager */ |
|
37 | - private $cloudFederationProviderManager; |
|
36 | + /** @var ICloudFederationProviderManager */ |
|
37 | + private $cloudFederationProviderManager; |
|
38 | 38 | |
39 | - public function __construct(ICloudFederationProviderManager $cloudFederationProviderManager) { |
|
40 | - $this->cloudFederationProviderManager = $cloudFederationProviderManager; |
|
41 | - } |
|
39 | + public function __construct(ICloudFederationProviderManager $cloudFederationProviderManager) { |
|
40 | + $this->cloudFederationProviderManager = $cloudFederationProviderManager; |
|
41 | + } |
|
42 | 42 | |
43 | - /** |
|
44 | - * get a list of supported share types |
|
45 | - * |
|
46 | - * @param string $resourceType |
|
47 | - * @return array |
|
48 | - */ |
|
49 | - public function getSupportedShareTypes($resourceType) { |
|
50 | - try { |
|
51 | - $provider = $this->cloudFederationProviderManager->getCloudFederationProvider($resourceType); |
|
52 | - return $provider->getSupportedShareTypes(); |
|
53 | - } catch (\Exception $e) { |
|
54 | - return []; |
|
55 | - } |
|
56 | - } |
|
43 | + /** |
|
44 | + * get a list of supported share types |
|
45 | + * |
|
46 | + * @param string $resourceType |
|
47 | + * @return array |
|
48 | + */ |
|
49 | + public function getSupportedShareTypes($resourceType) { |
|
50 | + try { |
|
51 | + $provider = $this->cloudFederationProviderManager->getCloudFederationProvider($resourceType); |
|
52 | + return $provider->getSupportedShareTypes(); |
|
53 | + } catch (\Exception $e) { |
|
54 | + return []; |
|
55 | + } |
|
56 | + } |
|
57 | 57 | |
58 | 58 | } |