@@ -25,33 +25,33 @@ |
||
25 | 25 | use OCP\Files\Search\ISearchOperator; |
26 | 26 | |
27 | 27 | class SearchBinaryOperator implements ISearchBinaryOperator { |
28 | - /** @var string */ |
|
29 | - private $type; |
|
30 | - /** @var ISearchOperator[] */ |
|
31 | - private $arguments; |
|
28 | + /** @var string */ |
|
29 | + private $type; |
|
30 | + /** @var ISearchOperator[] */ |
|
31 | + private $arguments; |
|
32 | 32 | |
33 | - /** |
|
34 | - * SearchBinaryOperator constructor. |
|
35 | - * |
|
36 | - * @param string $type |
|
37 | - * @param ISearchOperator[] $arguments |
|
38 | - */ |
|
39 | - public function __construct($type, array $arguments) { |
|
40 | - $this->type = $type; |
|
41 | - $this->arguments = $arguments; |
|
42 | - } |
|
33 | + /** |
|
34 | + * SearchBinaryOperator constructor. |
|
35 | + * |
|
36 | + * @param string $type |
|
37 | + * @param ISearchOperator[] $arguments |
|
38 | + */ |
|
39 | + public function __construct($type, array $arguments) { |
|
40 | + $this->type = $type; |
|
41 | + $this->arguments = $arguments; |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * @return string |
|
46 | - */ |
|
47 | - public function getType() { |
|
48 | - return $this->type; |
|
49 | - } |
|
44 | + /** |
|
45 | + * @return string |
|
46 | + */ |
|
47 | + public function getType() { |
|
48 | + return $this->type; |
|
49 | + } |
|
50 | 50 | |
51 | - /** |
|
52 | - * @return ISearchOperator[] |
|
53 | - */ |
|
54 | - public function getArguments() { |
|
55 | - return $this->arguments; |
|
56 | - } |
|
51 | + /** |
|
52 | + * @return ISearchOperator[] |
|
53 | + */ |
|
54 | + public function getArguments() { |
|
55 | + return $this->arguments; |
|
56 | + } |
|
57 | 57 | } |
@@ -27,101 +27,101 @@ |
||
27 | 27 | use OCP\Files\Search\ISearchQuery; |
28 | 28 | |
29 | 29 | class NullCache implements ICache { |
30 | - public function getNumericStorageId() { |
|
31 | - return -1; |
|
32 | - } |
|
33 | - |
|
34 | - public function get($file) { |
|
35 | - return $file !== '' ? null : |
|
36 | - new CacheEntry([ |
|
37 | - 'fileid' => -1, |
|
38 | - 'parent' => -1, |
|
39 | - 'name' => '', |
|
40 | - 'path' => '', |
|
41 | - 'size' => '0', |
|
42 | - 'mtime' => time(), |
|
43 | - 'storage_mtime' => time(), |
|
44 | - 'etag' => '', |
|
45 | - 'mimetype' => FileInfo::MIMETYPE_FOLDER, |
|
46 | - 'mimepart' => 'httpd', |
|
47 | - 'permissions' => Constants::PERMISSION_READ |
|
48 | - ]); |
|
49 | - } |
|
50 | - |
|
51 | - public function getFolderContents($folder) { |
|
52 | - return []; |
|
53 | - } |
|
54 | - |
|
55 | - public function getFolderContentsById($fileId) { |
|
56 | - return []; |
|
57 | - } |
|
58 | - |
|
59 | - public function put($file, array $data) { |
|
60 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
61 | - } |
|
62 | - |
|
63 | - public function insert($file, array $data) { |
|
64 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
65 | - } |
|
66 | - |
|
67 | - public function update($id, array $data) { |
|
68 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
69 | - } |
|
70 | - |
|
71 | - public function getId($file) { |
|
72 | - return -1; |
|
73 | - } |
|
74 | - |
|
75 | - public function getParentId($file) { |
|
76 | - return -1; |
|
77 | - } |
|
78 | - |
|
79 | - public function inCache($file) { |
|
80 | - return $file === ''; |
|
81 | - } |
|
82 | - |
|
83 | - public function remove($file) { |
|
84 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
85 | - } |
|
86 | - |
|
87 | - public function move($source, $target) { |
|
88 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
89 | - } |
|
90 | - |
|
91 | - public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) { |
|
92 | - throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
93 | - } |
|
94 | - |
|
95 | - public function getStatus($file) { |
|
96 | - return ICache::COMPLETE; |
|
97 | - } |
|
98 | - |
|
99 | - public function search($pattern) { |
|
100 | - return []; |
|
101 | - } |
|
102 | - |
|
103 | - public function searchByMime($mimetype) { |
|
104 | - return []; |
|
105 | - } |
|
106 | - |
|
107 | - public function searchQuery(ISearchQuery $query) { |
|
108 | - return []; |
|
109 | - } |
|
110 | - |
|
111 | - public function searchByTag($tag, $userId) { |
|
112 | - return []; |
|
113 | - } |
|
114 | - |
|
115 | - public function getIncomplete() { |
|
116 | - return []; |
|
117 | - } |
|
118 | - |
|
119 | - public function getPathById($id) { |
|
120 | - return ''; |
|
121 | - } |
|
122 | - |
|
123 | - public function normalize($path) { |
|
124 | - return $path; |
|
125 | - } |
|
30 | + public function getNumericStorageId() { |
|
31 | + return -1; |
|
32 | + } |
|
33 | + |
|
34 | + public function get($file) { |
|
35 | + return $file !== '' ? null : |
|
36 | + new CacheEntry([ |
|
37 | + 'fileid' => -1, |
|
38 | + 'parent' => -1, |
|
39 | + 'name' => '', |
|
40 | + 'path' => '', |
|
41 | + 'size' => '0', |
|
42 | + 'mtime' => time(), |
|
43 | + 'storage_mtime' => time(), |
|
44 | + 'etag' => '', |
|
45 | + 'mimetype' => FileInfo::MIMETYPE_FOLDER, |
|
46 | + 'mimepart' => 'httpd', |
|
47 | + 'permissions' => Constants::PERMISSION_READ |
|
48 | + ]); |
|
49 | + } |
|
50 | + |
|
51 | + public function getFolderContents($folder) { |
|
52 | + return []; |
|
53 | + } |
|
54 | + |
|
55 | + public function getFolderContentsById($fileId) { |
|
56 | + return []; |
|
57 | + } |
|
58 | + |
|
59 | + public function put($file, array $data) { |
|
60 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
61 | + } |
|
62 | + |
|
63 | + public function insert($file, array $data) { |
|
64 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
65 | + } |
|
66 | + |
|
67 | + public function update($id, array $data) { |
|
68 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
69 | + } |
|
70 | + |
|
71 | + public function getId($file) { |
|
72 | + return -1; |
|
73 | + } |
|
74 | + |
|
75 | + public function getParentId($file) { |
|
76 | + return -1; |
|
77 | + } |
|
78 | + |
|
79 | + public function inCache($file) { |
|
80 | + return $file === ''; |
|
81 | + } |
|
82 | + |
|
83 | + public function remove($file) { |
|
84 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
85 | + } |
|
86 | + |
|
87 | + public function move($source, $target) { |
|
88 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
89 | + } |
|
90 | + |
|
91 | + public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) { |
|
92 | + throw new \OC\ForbiddenException('This request is not allowed to access the filesystem'); |
|
93 | + } |
|
94 | + |
|
95 | + public function getStatus($file) { |
|
96 | + return ICache::COMPLETE; |
|
97 | + } |
|
98 | + |
|
99 | + public function search($pattern) { |
|
100 | + return []; |
|
101 | + } |
|
102 | + |
|
103 | + public function searchByMime($mimetype) { |
|
104 | + return []; |
|
105 | + } |
|
106 | + |
|
107 | + public function searchQuery(ISearchQuery $query) { |
|
108 | + return []; |
|
109 | + } |
|
110 | + |
|
111 | + public function searchByTag($tag, $userId) { |
|
112 | + return []; |
|
113 | + } |
|
114 | + |
|
115 | + public function getIncomplete() { |
|
116 | + return []; |
|
117 | + } |
|
118 | + |
|
119 | + public function getPathById($id) { |
|
120 | + return ''; |
|
121 | + } |
|
122 | + |
|
123 | + public function normalize($path) { |
|
124 | + return $path; |
|
125 | + } |
|
126 | 126 | |
127 | 127 | } |
@@ -45,114 +45,114 @@ |
||
45 | 45 | * @package OCA\DAV\Connector\Sabre |
46 | 46 | */ |
47 | 47 | class FakeLockerPlugin extends ServerPlugin { |
48 | - /** @var \Sabre\DAV\Server */ |
|
49 | - private $server; |
|
48 | + /** @var \Sabre\DAV\Server */ |
|
49 | + private $server; |
|
50 | 50 | |
51 | - /** {@inheritDoc} */ |
|
52 | - public function initialize(\Sabre\DAV\Server $server) { |
|
53 | - $this->server = $server; |
|
54 | - $this->server->on('method:LOCK', [$this, 'fakeLockProvider'], 1); |
|
55 | - $this->server->on('method:UNLOCK', [$this, 'fakeUnlockProvider'], 1); |
|
56 | - $server->on('propFind', [$this, 'propFind']); |
|
57 | - $server->on('validateTokens', [$this, 'validateTokens']); |
|
58 | - } |
|
51 | + /** {@inheritDoc} */ |
|
52 | + public function initialize(\Sabre\DAV\Server $server) { |
|
53 | + $this->server = $server; |
|
54 | + $this->server->on('method:LOCK', [$this, 'fakeLockProvider'], 1); |
|
55 | + $this->server->on('method:UNLOCK', [$this, 'fakeUnlockProvider'], 1); |
|
56 | + $server->on('propFind', [$this, 'propFind']); |
|
57 | + $server->on('validateTokens', [$this, 'validateTokens']); |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * Indicate that we support LOCK and UNLOCK |
|
62 | - * |
|
63 | - * @param string $path |
|
64 | - * @return string[] |
|
65 | - */ |
|
66 | - public function getHTTPMethods($path) { |
|
67 | - return [ |
|
68 | - 'LOCK', |
|
69 | - 'UNLOCK', |
|
70 | - ]; |
|
71 | - } |
|
60 | + /** |
|
61 | + * Indicate that we support LOCK and UNLOCK |
|
62 | + * |
|
63 | + * @param string $path |
|
64 | + * @return string[] |
|
65 | + */ |
|
66 | + public function getHTTPMethods($path) { |
|
67 | + return [ |
|
68 | + 'LOCK', |
|
69 | + 'UNLOCK', |
|
70 | + ]; |
|
71 | + } |
|
72 | 72 | |
73 | - /** |
|
74 | - * Indicate that we support locking |
|
75 | - * |
|
76 | - * @return integer[] |
|
77 | - */ |
|
78 | - function getFeatures() { |
|
79 | - return [2]; |
|
80 | - } |
|
73 | + /** |
|
74 | + * Indicate that we support locking |
|
75 | + * |
|
76 | + * @return integer[] |
|
77 | + */ |
|
78 | + function getFeatures() { |
|
79 | + return [2]; |
|
80 | + } |
|
81 | 81 | |
82 | - /** |
|
83 | - * Return some dummy response for PROPFIND requests with regard to locking |
|
84 | - * |
|
85 | - * @param PropFind $propFind |
|
86 | - * @param INode $node |
|
87 | - * @return void |
|
88 | - */ |
|
89 | - function propFind(PropFind $propFind, INode $node) { |
|
90 | - $propFind->handle('{DAV:}supportedlock', function() { |
|
91 | - return new SupportedLock(true); |
|
92 | - }); |
|
93 | - $propFind->handle('{DAV:}lockdiscovery', function() use ($propFind) { |
|
94 | - return new LockDiscovery([]); |
|
95 | - }); |
|
96 | - } |
|
82 | + /** |
|
83 | + * Return some dummy response for PROPFIND requests with regard to locking |
|
84 | + * |
|
85 | + * @param PropFind $propFind |
|
86 | + * @param INode $node |
|
87 | + * @return void |
|
88 | + */ |
|
89 | + function propFind(PropFind $propFind, INode $node) { |
|
90 | + $propFind->handle('{DAV:}supportedlock', function() { |
|
91 | + return new SupportedLock(true); |
|
92 | + }); |
|
93 | + $propFind->handle('{DAV:}lockdiscovery', function() use ($propFind) { |
|
94 | + return new LockDiscovery([]); |
|
95 | + }); |
|
96 | + } |
|
97 | 97 | |
98 | - /** |
|
99 | - * Mark a locking token always as valid |
|
100 | - * |
|
101 | - * @param RequestInterface $request |
|
102 | - * @param array $conditions |
|
103 | - */ |
|
104 | - public function validateTokens(RequestInterface $request, &$conditions) { |
|
105 | - foreach($conditions as &$fileCondition) { |
|
106 | - if(isset($fileCondition['tokens'])) { |
|
107 | - foreach($fileCondition['tokens'] as &$token) { |
|
108 | - if(isset($token['token'])) { |
|
109 | - if(substr($token['token'], 0, 16) === 'opaquelocktoken:') { |
|
110 | - $token['validToken'] = true; |
|
111 | - } |
|
112 | - } |
|
113 | - } |
|
114 | - } |
|
115 | - } |
|
116 | - } |
|
98 | + /** |
|
99 | + * Mark a locking token always as valid |
|
100 | + * |
|
101 | + * @param RequestInterface $request |
|
102 | + * @param array $conditions |
|
103 | + */ |
|
104 | + public function validateTokens(RequestInterface $request, &$conditions) { |
|
105 | + foreach($conditions as &$fileCondition) { |
|
106 | + if(isset($fileCondition['tokens'])) { |
|
107 | + foreach($fileCondition['tokens'] as &$token) { |
|
108 | + if(isset($token['token'])) { |
|
109 | + if(substr($token['token'], 0, 16) === 'opaquelocktoken:') { |
|
110 | + $token['validToken'] = true; |
|
111 | + } |
|
112 | + } |
|
113 | + } |
|
114 | + } |
|
115 | + } |
|
116 | + } |
|
117 | 117 | |
118 | - /** |
|
119 | - * Fakes a successful LOCK |
|
120 | - * |
|
121 | - * @param RequestInterface $request |
|
122 | - * @param ResponseInterface $response |
|
123 | - * @return bool |
|
124 | - */ |
|
125 | - public function fakeLockProvider(RequestInterface $request, |
|
126 | - ResponseInterface $response) { |
|
118 | + /** |
|
119 | + * Fakes a successful LOCK |
|
120 | + * |
|
121 | + * @param RequestInterface $request |
|
122 | + * @param ResponseInterface $response |
|
123 | + * @return bool |
|
124 | + */ |
|
125 | + public function fakeLockProvider(RequestInterface $request, |
|
126 | + ResponseInterface $response) { |
|
127 | 127 | |
128 | - $lockInfo = new LockInfo(); |
|
129 | - $lockInfo->token = md5($request->getPath()); |
|
130 | - $lockInfo->uri = $request->getPath(); |
|
131 | - $lockInfo->depth = \Sabre\DAV\Server::DEPTH_INFINITY; |
|
132 | - $lockInfo->timeout = 1800; |
|
128 | + $lockInfo = new LockInfo(); |
|
129 | + $lockInfo->token = md5($request->getPath()); |
|
130 | + $lockInfo->uri = $request->getPath(); |
|
131 | + $lockInfo->depth = \Sabre\DAV\Server::DEPTH_INFINITY; |
|
132 | + $lockInfo->timeout = 1800; |
|
133 | 133 | |
134 | - $body = $this->server->xml->write('{DAV:}prop', [ |
|
135 | - '{DAV:}lockdiscovery' => |
|
136 | - new LockDiscovery([$lockInfo]) |
|
137 | - ]); |
|
134 | + $body = $this->server->xml->write('{DAV:}prop', [ |
|
135 | + '{DAV:}lockdiscovery' => |
|
136 | + new LockDiscovery([$lockInfo]) |
|
137 | + ]); |
|
138 | 138 | |
139 | - $response->setStatus(200); |
|
140 | - $response->setBody($body); |
|
139 | + $response->setStatus(200); |
|
140 | + $response->setBody($body); |
|
141 | 141 | |
142 | - return false; |
|
143 | - } |
|
142 | + return false; |
|
143 | + } |
|
144 | 144 | |
145 | - /** |
|
146 | - * Fakes a successful LOCK |
|
147 | - * |
|
148 | - * @param RequestInterface $request |
|
149 | - * @param ResponseInterface $response |
|
150 | - * @return bool |
|
151 | - */ |
|
152 | - public function fakeUnlockProvider(RequestInterface $request, |
|
153 | - ResponseInterface $response) { |
|
154 | - $response->setStatus(204); |
|
155 | - $response->setHeader('Content-Length', '0'); |
|
156 | - return false; |
|
157 | - } |
|
145 | + /** |
|
146 | + * Fakes a successful LOCK |
|
147 | + * |
|
148 | + * @param RequestInterface $request |
|
149 | + * @param ResponseInterface $response |
|
150 | + * @return bool |
|
151 | + */ |
|
152 | + public function fakeUnlockProvider(RequestInterface $request, |
|
153 | + ResponseInterface $response) { |
|
154 | + $response->setStatus(204); |
|
155 | + $response->setHeader('Content-Length', '0'); |
|
156 | + return false; |
|
157 | + } |
|
158 | 158 | } |
@@ -27,41 +27,41 @@ |
||
27 | 27 | * @since 12.0.0 |
28 | 28 | */ |
29 | 29 | interface ISearchQuery { |
30 | - /** |
|
31 | - * @return ISearchOperator |
|
32 | - * @since 12.0.0 |
|
33 | - */ |
|
34 | - public function getSearchOperation(); |
|
30 | + /** |
|
31 | + * @return ISearchOperator |
|
32 | + * @since 12.0.0 |
|
33 | + */ |
|
34 | + public function getSearchOperation(); |
|
35 | 35 | |
36 | - /** |
|
37 | - * Get the maximum number of results to return |
|
38 | - * |
|
39 | - * @return integer |
|
40 | - * @since 12.0.0 |
|
41 | - */ |
|
42 | - public function getLimit(); |
|
36 | + /** |
|
37 | + * Get the maximum number of results to return |
|
38 | + * |
|
39 | + * @return integer |
|
40 | + * @since 12.0.0 |
|
41 | + */ |
|
42 | + public function getLimit(); |
|
43 | 43 | |
44 | - /** |
|
45 | - * Get the offset for returned results |
|
46 | - * |
|
47 | - * @return integer |
|
48 | - * @since 12.0.0 |
|
49 | - */ |
|
50 | - public function getOffset(); |
|
44 | + /** |
|
45 | + * Get the offset for returned results |
|
46 | + * |
|
47 | + * @return integer |
|
48 | + * @since 12.0.0 |
|
49 | + */ |
|
50 | + public function getOffset(); |
|
51 | 51 | |
52 | - /** |
|
53 | - * The fields and directions to order by |
|
54 | - * |
|
55 | - * @return ISearchOrder[] |
|
56 | - * @since 12.0.0 |
|
57 | - */ |
|
58 | - public function getOrder(); |
|
52 | + /** |
|
53 | + * The fields and directions to order by |
|
54 | + * |
|
55 | + * @return ISearchOrder[] |
|
56 | + * @since 12.0.0 |
|
57 | + */ |
|
58 | + public function getOrder(); |
|
59 | 59 | |
60 | - /** |
|
61 | - * The user that issued the search |
|
62 | - * |
|
63 | - * @return IUser |
|
64 | - * @since 12.0.0 |
|
65 | - */ |
|
66 | - public function getUser(); |
|
60 | + /** |
|
61 | + * The user that issued the search |
|
62 | + * |
|
63 | + * @return IUser |
|
64 | + * @since 12.0.0 |
|
65 | + */ |
|
66 | + public function getUser(); |
|
67 | 67 | } |
@@ -27,66 +27,66 @@ |
||
27 | 27 | use OCP\IUser; |
28 | 28 | |
29 | 29 | class SearchQuery implements ISearchQuery { |
30 | - /** @var ISearchOperator */ |
|
31 | - private $searchOperation; |
|
32 | - /** @var integer */ |
|
33 | - private $limit; |
|
34 | - /** @var integer */ |
|
35 | - private $offset; |
|
36 | - /** @var ISearchOrder[] */ |
|
37 | - private $order; |
|
38 | - /** @var IUser */ |
|
39 | - private $user; |
|
30 | + /** @var ISearchOperator */ |
|
31 | + private $searchOperation; |
|
32 | + /** @var integer */ |
|
33 | + private $limit; |
|
34 | + /** @var integer */ |
|
35 | + private $offset; |
|
36 | + /** @var ISearchOrder[] */ |
|
37 | + private $order; |
|
38 | + /** @var IUser */ |
|
39 | + private $user; |
|
40 | 40 | |
41 | - /** |
|
42 | - * SearchQuery constructor. |
|
43 | - * |
|
44 | - * @param ISearchOperator $searchOperation |
|
45 | - * @param int $limit |
|
46 | - * @param int $offset |
|
47 | - * @param array $order |
|
48 | - * @param IUser $user |
|
49 | - */ |
|
50 | - public function __construct(ISearchOperator $searchOperation, $limit, $offset, array $order, IUser $user) { |
|
51 | - $this->searchOperation = $searchOperation; |
|
52 | - $this->limit = $limit; |
|
53 | - $this->offset = $offset; |
|
54 | - $this->order = $order; |
|
55 | - $this->user = $user; |
|
56 | - } |
|
41 | + /** |
|
42 | + * SearchQuery constructor. |
|
43 | + * |
|
44 | + * @param ISearchOperator $searchOperation |
|
45 | + * @param int $limit |
|
46 | + * @param int $offset |
|
47 | + * @param array $order |
|
48 | + * @param IUser $user |
|
49 | + */ |
|
50 | + public function __construct(ISearchOperator $searchOperation, $limit, $offset, array $order, IUser $user) { |
|
51 | + $this->searchOperation = $searchOperation; |
|
52 | + $this->limit = $limit; |
|
53 | + $this->offset = $offset; |
|
54 | + $this->order = $order; |
|
55 | + $this->user = $user; |
|
56 | + } |
|
57 | 57 | |
58 | - /** |
|
59 | - * @return ISearchOperator |
|
60 | - */ |
|
61 | - public function getSearchOperation() { |
|
62 | - return $this->searchOperation; |
|
63 | - } |
|
58 | + /** |
|
59 | + * @return ISearchOperator |
|
60 | + */ |
|
61 | + public function getSearchOperation() { |
|
62 | + return $this->searchOperation; |
|
63 | + } |
|
64 | 64 | |
65 | - /** |
|
66 | - * @return int |
|
67 | - */ |
|
68 | - public function getLimit() { |
|
69 | - return $this->limit; |
|
70 | - } |
|
65 | + /** |
|
66 | + * @return int |
|
67 | + */ |
|
68 | + public function getLimit() { |
|
69 | + return $this->limit; |
|
70 | + } |
|
71 | 71 | |
72 | - /** |
|
73 | - * @return int |
|
74 | - */ |
|
75 | - public function getOffset() { |
|
76 | - return $this->offset; |
|
77 | - } |
|
72 | + /** |
|
73 | + * @return int |
|
74 | + */ |
|
75 | + public function getOffset() { |
|
76 | + return $this->offset; |
|
77 | + } |
|
78 | 78 | |
79 | - /** |
|
80 | - * @return ISearchOrder[] |
|
81 | - */ |
|
82 | - public function getOrder() { |
|
83 | - return $this->order; |
|
84 | - } |
|
79 | + /** |
|
80 | + * @return ISearchOrder[] |
|
81 | + */ |
|
82 | + public function getOrder() { |
|
83 | + return $this->order; |
|
84 | + } |
|
85 | 85 | |
86 | - /** |
|
87 | - * @return IUser |
|
88 | - */ |
|
89 | - public function getUser() { |
|
90 | - return $this->user; |
|
91 | - } |
|
86 | + /** |
|
87 | + * @return IUser |
|
88 | + */ |
|
89 | + public function getUser() { |
|
90 | + return $this->user; |
|
91 | + } |
|
92 | 92 | } |
@@ -24,92 +24,92 @@ |
||
24 | 24 | namespace OC\OCS; |
25 | 25 | |
26 | 26 | class Provider extends \OCP\AppFramework\Controller { |
27 | - /** @var \OCP\App\IAppManager */ |
|
28 | - private $appManager; |
|
27 | + /** @var \OCP\App\IAppManager */ |
|
28 | + private $appManager; |
|
29 | 29 | |
30 | - /** |
|
31 | - * @param string $appName |
|
32 | - * @param \OCP\IRequest $request |
|
33 | - * @param \OCP\App\IAppManager $appManager |
|
34 | - */ |
|
35 | - public function __construct($appName, |
|
36 | - \OCP\IRequest $request, |
|
37 | - \OCP\App\IAppManager $appManager) { |
|
38 | - parent::__construct($appName, $request); |
|
39 | - $this->appManager = $appManager; |
|
40 | - } |
|
30 | + /** |
|
31 | + * @param string $appName |
|
32 | + * @param \OCP\IRequest $request |
|
33 | + * @param \OCP\App\IAppManager $appManager |
|
34 | + */ |
|
35 | + public function __construct($appName, |
|
36 | + \OCP\IRequest $request, |
|
37 | + \OCP\App\IAppManager $appManager) { |
|
38 | + parent::__construct($appName, $request); |
|
39 | + $this->appManager = $appManager; |
|
40 | + } |
|
41 | 41 | |
42 | - /** |
|
43 | - * @return \OCP\AppFramework\Http\JSONResponse |
|
44 | - */ |
|
45 | - public function buildProviderList() { |
|
46 | - $services = [ |
|
47 | - 'PRIVATE_DATA' => [ |
|
48 | - 'version' => 1, |
|
49 | - 'endpoints' => [ |
|
50 | - 'store' => '/ocs/v2.php/privatedata/setattribute', |
|
51 | - 'read' => '/ocs/v2.php/privatedata/getattribute', |
|
52 | - 'delete' => '/ocs/v2.php/privatedata/deleteattribute', |
|
53 | - ], |
|
54 | - ], |
|
55 | - ]; |
|
42 | + /** |
|
43 | + * @return \OCP\AppFramework\Http\JSONResponse |
|
44 | + */ |
|
45 | + public function buildProviderList() { |
|
46 | + $services = [ |
|
47 | + 'PRIVATE_DATA' => [ |
|
48 | + 'version' => 1, |
|
49 | + 'endpoints' => [ |
|
50 | + 'store' => '/ocs/v2.php/privatedata/setattribute', |
|
51 | + 'read' => '/ocs/v2.php/privatedata/getattribute', |
|
52 | + 'delete' => '/ocs/v2.php/privatedata/deleteattribute', |
|
53 | + ], |
|
54 | + ], |
|
55 | + ]; |
|
56 | 56 | |
57 | - if($this->appManager->isEnabledForUser('files_sharing')) { |
|
58 | - $services['SHARING'] = [ |
|
59 | - 'version' => 1, |
|
60 | - 'endpoints' => [ |
|
61 | - 'share' => '/ocs/v2.php/apps/files_sharing/api/v1/shares', |
|
62 | - ], |
|
63 | - ]; |
|
64 | - $services['FEDERATED_SHARING'] = [ |
|
65 | - 'version' => 1, |
|
66 | - 'endpoints' => [ |
|
67 | - 'share' => '/ocs/v2.php/cloud/shares', |
|
68 | - 'webdav' => '/public.php/webdav/', |
|
69 | - ], |
|
70 | - ]; |
|
71 | - } |
|
57 | + if($this->appManager->isEnabledForUser('files_sharing')) { |
|
58 | + $services['SHARING'] = [ |
|
59 | + 'version' => 1, |
|
60 | + 'endpoints' => [ |
|
61 | + 'share' => '/ocs/v2.php/apps/files_sharing/api/v1/shares', |
|
62 | + ], |
|
63 | + ]; |
|
64 | + $services['FEDERATED_SHARING'] = [ |
|
65 | + 'version' => 1, |
|
66 | + 'endpoints' => [ |
|
67 | + 'share' => '/ocs/v2.php/cloud/shares', |
|
68 | + 'webdav' => '/public.php/webdav/', |
|
69 | + ], |
|
70 | + ]; |
|
71 | + } |
|
72 | 72 | |
73 | - if ($this->appManager->isEnabledForUser('federation')) { |
|
74 | - if (isset($services['FEDERATED_SHARING'])) { |
|
75 | - $services['FEDERATED_SHARING']['endpoints']['shared-secret'] = '/ocs/v2.php/cloud/shared-secret'; |
|
76 | - $services['FEDERATED_SHARING']['endpoints']['system-address-book'] = '/remote.php/dav/addressbooks/system/system/system'; |
|
77 | - $services['FEDERATED_SHARING']['endpoints']['carddav-user'] = 'system'; |
|
78 | - } else { |
|
79 | - $services['FEDERATED_SHARING'] = [ |
|
80 | - 'version' => 1, |
|
81 | - 'endpoints' => [ |
|
82 | - 'shared-secret' => '/ocs/v2.php/cloud/shared-secret', |
|
83 | - 'system-address-book' => '/remote.php/dav/addressbooks/system/system/system', |
|
84 | - 'carddav-user' => 'system' |
|
85 | - ], |
|
86 | - ]; |
|
87 | - } |
|
88 | - } |
|
73 | + if ($this->appManager->isEnabledForUser('federation')) { |
|
74 | + if (isset($services['FEDERATED_SHARING'])) { |
|
75 | + $services['FEDERATED_SHARING']['endpoints']['shared-secret'] = '/ocs/v2.php/cloud/shared-secret'; |
|
76 | + $services['FEDERATED_SHARING']['endpoints']['system-address-book'] = '/remote.php/dav/addressbooks/system/system/system'; |
|
77 | + $services['FEDERATED_SHARING']['endpoints']['carddav-user'] = 'system'; |
|
78 | + } else { |
|
79 | + $services['FEDERATED_SHARING'] = [ |
|
80 | + 'version' => 1, |
|
81 | + 'endpoints' => [ |
|
82 | + 'shared-secret' => '/ocs/v2.php/cloud/shared-secret', |
|
83 | + 'system-address-book' => '/remote.php/dav/addressbooks/system/system/system', |
|
84 | + 'carddav-user' => 'system' |
|
85 | + ], |
|
86 | + ]; |
|
87 | + } |
|
88 | + } |
|
89 | 89 | |
90 | - if($this->appManager->isEnabledForUser('activity')) { |
|
91 | - $services['ACTIVITY'] = [ |
|
92 | - 'version' => 1, |
|
93 | - 'endpoints' => [ |
|
94 | - 'list' => '/ocs/v2.php/cloud/activity', |
|
95 | - ], |
|
96 | - ]; |
|
97 | - } |
|
90 | + if($this->appManager->isEnabledForUser('activity')) { |
|
91 | + $services['ACTIVITY'] = [ |
|
92 | + 'version' => 1, |
|
93 | + 'endpoints' => [ |
|
94 | + 'list' => '/ocs/v2.php/cloud/activity', |
|
95 | + ], |
|
96 | + ]; |
|
97 | + } |
|
98 | 98 | |
99 | - if($this->appManager->isEnabledForUser('provisioning_api')) { |
|
100 | - $services['PROVISIONING'] = [ |
|
101 | - 'version' => 1, |
|
102 | - 'endpoints' => [ |
|
103 | - 'user' => '/ocs/v2.php/cloud/users', |
|
104 | - 'groups' => '/ocs/v2.php/cloud/groups', |
|
105 | - 'apps' => '/ocs/v2.php/cloud/apps', |
|
106 | - ], |
|
107 | - ]; |
|
108 | - } |
|
99 | + if($this->appManager->isEnabledForUser('provisioning_api')) { |
|
100 | + $services['PROVISIONING'] = [ |
|
101 | + 'version' => 1, |
|
102 | + 'endpoints' => [ |
|
103 | + 'user' => '/ocs/v2.php/cloud/users', |
|
104 | + 'groups' => '/ocs/v2.php/cloud/groups', |
|
105 | + 'apps' => '/ocs/v2.php/cloud/apps', |
|
106 | + ], |
|
107 | + ]; |
|
108 | + } |
|
109 | 109 | |
110 | - return new \OCP\AppFramework\Http\JSONResponse([ |
|
111 | - 'version' => 2, |
|
112 | - 'services' => $services, |
|
113 | - ]); |
|
114 | - } |
|
110 | + return new \OCP\AppFramework\Http\JSONResponse([ |
|
111 | + 'version' => 2, |
|
112 | + 'services' => $services, |
|
113 | + ]); |
|
114 | + } |
|
115 | 115 | } |
@@ -29,38 +29,38 @@ |
||
29 | 29 | use ID3Parser\ID3Parser; |
30 | 30 | |
31 | 31 | class MP3 extends Provider { |
32 | - /** |
|
33 | - * {@inheritDoc} |
|
34 | - */ |
|
35 | - public function getMimeType() { |
|
36 | - return '/audio\/mpeg/'; |
|
37 | - } |
|
32 | + /** |
|
33 | + * {@inheritDoc} |
|
34 | + */ |
|
35 | + public function getMimeType() { |
|
36 | + return '/audio\/mpeg/'; |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * {@inheritDoc} |
|
41 | - */ |
|
42 | - public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) { |
|
43 | - $getID3 = new ID3Parser(); |
|
39 | + /** |
|
40 | + * {@inheritDoc} |
|
41 | + */ |
|
42 | + public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) { |
|
43 | + $getID3 = new ID3Parser(); |
|
44 | 44 | |
45 | - $tmpPath = $fileview->toTmpFile($path); |
|
46 | - $tags = $getID3->analyze($tmpPath); |
|
47 | - unlink($tmpPath); |
|
48 | - $picture = isset($tags['id3v2']['APIC'][0]['data']) ? $tags['id3v2']['APIC'][0]['data'] : null; |
|
49 | - if(is_null($picture) && isset($tags['id3v2']['PIC'][0]['data'])) { |
|
50 | - $picture = $tags['id3v2']['PIC'][0]['data']; |
|
51 | - } |
|
45 | + $tmpPath = $fileview->toTmpFile($path); |
|
46 | + $tags = $getID3->analyze($tmpPath); |
|
47 | + unlink($tmpPath); |
|
48 | + $picture = isset($tags['id3v2']['APIC'][0]['data']) ? $tags['id3v2']['APIC'][0]['data'] : null; |
|
49 | + if(is_null($picture) && isset($tags['id3v2']['PIC'][0]['data'])) { |
|
50 | + $picture = $tags['id3v2']['PIC'][0]['data']; |
|
51 | + } |
|
52 | 52 | |
53 | - if(!is_null($picture)) { |
|
54 | - $image = new \OC_Image(); |
|
55 | - $image->loadFromData($picture); |
|
53 | + if(!is_null($picture)) { |
|
54 | + $image = new \OC_Image(); |
|
55 | + $image->loadFromData($picture); |
|
56 | 56 | |
57 | - if ($image->valid()) { |
|
58 | - $image->scaleDownToFit($maxX, $maxY); |
|
57 | + if ($image->valid()) { |
|
58 | + $image->scaleDownToFit($maxX, $maxY); |
|
59 | 59 | |
60 | - return $image; |
|
61 | - } |
|
62 | - } |
|
60 | + return $image; |
|
61 | + } |
|
62 | + } |
|
63 | 63 | |
64 | - return false; |
|
65 | - } |
|
64 | + return false; |
|
65 | + } |
|
66 | 66 | } |
@@ -23,18 +23,18 @@ |
||
23 | 23 | */ |
24 | 24 | |
25 | 25 | return [ |
26 | - 'routes' => [ |
|
27 | - ['name' => 'MountPublicLink#createFederatedShare', 'url' => '/createFederatedShare', 'verb' => 'POST'], |
|
28 | - ['name' => 'MountPublicLink#askForFederatedShare', 'url' => '/askForFederatedShare', 'verb' => 'POST'], |
|
29 | - ], |
|
30 | - 'ocs' => [ |
|
31 | - ['root' => '/cloud', 'name' => 'RequestHandler#createShare', 'url' => '/shares', 'verb' => 'POST'], |
|
32 | - ['root' => '/cloud', 'name' => 'RequestHandler#reShare', 'url' => '/shares/{id}/reshare', 'verb' => 'POST'], |
|
33 | - ['root' => '/cloud', 'name' => 'RequestHandler#updatePermissions', 'url' => '/shares/{id}/permissions', 'verb' => 'POST'], |
|
34 | - ['root' => '/cloud', 'name' => 'RequestHandler#acceptShare', 'url' => '/shares/{id}/accept', 'verb' => 'POST'], |
|
35 | - ['root' => '/cloud', 'name' => 'RequestHandler#declineShare', 'url' => '/shares/{id}/decline', 'verb' => 'POST'], |
|
36 | - ['root' => '/cloud', 'name' => 'RequestHandler#unshare', 'url' => '/shares/{id}/unshare', 'verb' => 'POST'], |
|
37 | - ['root' => '/cloud', 'name' => 'RequestHandler#revoke', 'url' => '/shares/{id}/revoke', 'verb' => 'POST'], |
|
38 | - ['root' => '/cloud', 'name' => 'RequestHandler#move', 'url' => '/shares/{id}/move', 'verb' => 'POST'], |
|
39 | - ], |
|
26 | + 'routes' => [ |
|
27 | + ['name' => 'MountPublicLink#createFederatedShare', 'url' => '/createFederatedShare', 'verb' => 'POST'], |
|
28 | + ['name' => 'MountPublicLink#askForFederatedShare', 'url' => '/askForFederatedShare', 'verb' => 'POST'], |
|
29 | + ], |
|
30 | + 'ocs' => [ |
|
31 | + ['root' => '/cloud', 'name' => 'RequestHandler#createShare', 'url' => '/shares', 'verb' => 'POST'], |
|
32 | + ['root' => '/cloud', 'name' => 'RequestHandler#reShare', 'url' => '/shares/{id}/reshare', 'verb' => 'POST'], |
|
33 | + ['root' => '/cloud', 'name' => 'RequestHandler#updatePermissions', 'url' => '/shares/{id}/permissions', 'verb' => 'POST'], |
|
34 | + ['root' => '/cloud', 'name' => 'RequestHandler#acceptShare', 'url' => '/shares/{id}/accept', 'verb' => 'POST'], |
|
35 | + ['root' => '/cloud', 'name' => 'RequestHandler#declineShare', 'url' => '/shares/{id}/decline', 'verb' => 'POST'], |
|
36 | + ['root' => '/cloud', 'name' => 'RequestHandler#unshare', 'url' => '/shares/{id}/unshare', 'verb' => 'POST'], |
|
37 | + ['root' => '/cloud', 'name' => 'RequestHandler#revoke', 'url' => '/shares/{id}/revoke', 'verb' => 'POST'], |
|
38 | + ['root' => '/cloud', 'name' => 'RequestHandler#move', 'url' => '/shares/{id}/move', 'verb' => 'POST'], |
|
39 | + ], |
|
40 | 40 | ]; |
@@ -21,7 +21,7 @@ |
||
21 | 21 | */ |
22 | 22 | // no php execution timeout for webdav |
23 | 23 | if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) { |
24 | - @set_time_limit(0); |
|
24 | + @set_time_limit(0); |
|
25 | 25 | } |
26 | 26 | ignore_user_abort(true); |
27 | 27 |