@@ -65,7 +65,7 @@ |
||
65 | 65 | $eventDispatcher->addListener(MapperEvent::EVENT_ASSIGN, $mapperListener); |
66 | 66 | $eventDispatcher->addListener(MapperEvent::EVENT_UNASSIGN, $mapperListener); |
67 | 67 | |
68 | -\OCA\Files\App::getNavigationManager()->add(function () { |
|
68 | +\OCA\Files\App::getNavigationManager()->add(function() { |
|
69 | 69 | $l = \OC::$server->getL10N('systemtags'); |
70 | 70 | return [ |
71 | 71 | 'id' => 'systemtagsfilter', |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | $config = \OC::$server->getConfig(); |
52 | 52 | if ($config->getAppValue('core', 'shareapi_enabled', 'yes') === 'yes') { |
53 | - \OCA\Files\App::getNavigationManager()->add(function () { |
|
53 | + \OCA\Files\App::getNavigationManager()->add(function() { |
|
54 | 54 | $l = \OC::$server->getL10N('files_sharing'); |
55 | 55 | return [ |
56 | 56 | 'id' => 'sharingin', |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | }); |
63 | 63 | |
64 | 64 | if (\OCP\Util::isSharingDisabledForUser() === false) { |
65 | - \OCA\Files\App::getNavigationManager()->add(function () { |
|
65 | + \OCA\Files\App::getNavigationManager()->add(function() { |
|
66 | 66 | $l = \OC::$server->getL10N('files_sharing'); |
67 | 67 | return [ |
68 | 68 | 'id' => 'sharingout', |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | // Check if sharing by link is enabled |
77 | 77 | if ($config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') { |
78 | - \OCA\Files\App::getNavigationManager()->add(function () { |
|
78 | + \OCA\Files\App::getNavigationManager()->add(function() { |
|
79 | 79 | $l = \OC::$server->getL10N('files_sharing'); |
80 | 80 | return [ |
81 | 81 | 'id' => 'sharinglinks', |
@@ -28,7 +28,7 @@ |
||
28 | 28 | // register hooks |
29 | 29 | \OCA\Files_Trashbin\Trashbin::registerHooks(); |
30 | 30 | |
31 | -\OCA\Files\App::getNavigationManager()->add(function () { |
|
31 | +\OCA\Files\App::getNavigationManager()->add(function() { |
|
32 | 32 | $l = \OC::$server->getL10N('files_trashbin'); |
33 | 33 | return [ |
34 | 34 | 'id' => 'trashbin', |
@@ -119,9 +119,9 @@ |
||
119 | 119 | $elements = explode(' ', $fullName); |
120 | 120 | $result = ['', '', '', '', '']; |
121 | 121 | if (count($elements) > 2) { |
122 | - $result[0] = implode(' ', array_slice($elements, count($elements)-1)); |
|
122 | + $result[0] = implode(' ', array_slice($elements, count($elements) - 1)); |
|
123 | 123 | $result[1] = $elements[0]; |
124 | - $result[2] = implode(' ', array_slice($elements, 1, count($elements)-2)); |
|
124 | + $result[2] = implode(' ', array_slice($elements, 1, count($elements) - 2)); |
|
125 | 125 | } elseif (count($elements) === 2) { |
126 | 126 | $result[0] = $elements[1]; |
127 | 127 | $result[1] = $elements[0]; |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function discover($remote, $service) { |
62 | 62 | // Check the cache first |
63 | - $cacheData = $this->cache->get($remote . '#' . $service); |
|
64 | - if($cacheData) { |
|
63 | + $cacheData = $this->cache->get($remote.'#'.$service); |
|
64 | + if ($cacheData) { |
|
65 | 65 | return json_decode($cacheData, true); |
66 | 66 | } |
67 | 67 | |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | |
70 | 70 | // query the remote server for available services |
71 | 71 | try { |
72 | - $response = $this->client->get($remote . '/ocs-provider/', [ |
|
72 | + $response = $this->client->get($remote.'/ocs-provider/', [ |
|
73 | 73 | 'timeout' => 10, |
74 | 74 | 'connect_timeout' => 10, |
75 | 75 | ]); |
76 | - if($response->getStatusCode() === Http::STATUS_OK) { |
|
76 | + if ($response->getStatusCode() === Http::STATUS_OK) { |
|
77 | 77 | $decodedServices = json_decode($response->getBody(), true); |
78 | 78 | $discoveredServices = $this->getEndpoints($decodedServices, $service); |
79 | 79 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | // Write into cache |
86 | - $this->cache->set($remote . '#' . $service, json_encode($discoveredServices)); |
|
86 | + $this->cache->set($remote.'#'.$service, json_encode($discoveredServices)); |
|
87 | 87 | return $discoveredServices; |
88 | 88 | } |
89 | 89 | |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | |
99 | 99 | $discoveredServices = []; |
100 | 100 | |
101 | - if(is_array($decodedServices) && |
|
101 | + if (is_array($decodedServices) && |
|
102 | 102 | isset($decodedServices['services'][$service]['endpoints']) |
103 | 103 | ) { |
104 | 104 | foreach ($decodedServices['services'][$service]['endpoints'] as $endpoint => $url) { |
105 | - if($this->isSafeUrl($url)) { |
|
105 | + if ($this->isSafeUrl($url)) { |
|
106 | 106 | $discoveredServices[$endpoint] = $url; |
107 | 107 | } |
108 | 108 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * @return bool |
120 | 120 | */ |
121 | 121 | protected function isSafeUrl($url) { |
122 | - return (bool)preg_match('/^[\/\.\-A-Za-z0-9]+$/', $url); |
|
122 | + return (bool) preg_match('/^[\/\.\-A-Za-z0-9]+$/', $url); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | if ($currentUser) { |
96 | 96 | $currentUserId = $currentUser->getUID(); |
97 | 97 | |
98 | - $view = new View($currentUserId . '/files'); |
|
98 | + $view = new View($currentUserId.'/files'); |
|
99 | 99 | $fileInfo = $view->getFileInfo($oldPath); |
100 | 100 | if ($fileInfo) { |
101 | 101 | $sourceStorage = $fileInfo->getStorage(); |
@@ -112,11 +112,11 @@ discard block |
||
112 | 112 | } catch (\Exception $e) { |
113 | 113 | // do nothing, in this case we just disable the trashbin and continue |
114 | 114 | $logger = \OC::$server->getLogger(); |
115 | - $logger->debug('Trashbin storage could not check if a file was moved out of a shared folder: ' . $e->getMessage()); |
|
115 | + $logger->debug('Trashbin storage could not check if a file was moved out of a shared folder: '.$e->getMessage()); |
|
116 | 116 | } |
117 | 117 | |
118 | - if($fileMovedOutOfSharedFolder) { |
|
119 | - self::$moveOutOfSharedFolder['/' . $currentUserId . '/files' . $oldPath] = true; |
|
118 | + if ($fileMovedOutOfSharedFolder) { |
|
119 | + self::$moveOutOfSharedFolder['/'.$currentUserId.'/files'.$oldPath] = true; |
|
120 | 120 | } else { |
121 | 121 | self::$disableTrash = true; |
122 | 122 | } |
@@ -156,16 +156,16 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public function unlink($path) { |
158 | 158 | try { |
159 | - if (isset(self::$moveOutOfSharedFolder[$this->mountPoint . $path])) { |
|
159 | + if (isset(self::$moveOutOfSharedFolder[$this->mountPoint.$path])) { |
|
160 | 160 | $result = $this->doDelete($path, 'unlink', true); |
161 | - unset(self::$moveOutOfSharedFolder[$this->mountPoint . $path]); |
|
161 | + unset(self::$moveOutOfSharedFolder[$this->mountPoint.$path]); |
|
162 | 162 | } else { |
163 | 163 | $result = $this->doDelete($path, 'unlink'); |
164 | 164 | } |
165 | 165 | } catch (GenericEncryptionException $e) { |
166 | 166 | // in case of a encryption exception we delete the file right away |
167 | 167 | $this->logger->info( |
168 | - "Can't move file" . $path . |
|
168 | + "Can't move file".$path. |
|
169 | 169 | "to the trash bin, therefore it was deleted right away"); |
170 | 170 | |
171 | 171 | $result = $this->storage->unlink($path); |
@@ -182,9 +182,9 @@ discard block |
||
182 | 182 | * @return bool true if the operation succeeded, false otherwise |
183 | 183 | */ |
184 | 184 | public function rmdir($path) { |
185 | - if (isset(self::$moveOutOfSharedFolder[$this->mountPoint . $path])) { |
|
185 | + if (isset(self::$moveOutOfSharedFolder[$this->mountPoint.$path])) { |
|
186 | 186 | $result = $this->doDelete($path, 'rmdir', true); |
187 | - unset(self::$moveOutOfSharedFolder[$this->mountPoint . $path]); |
|
187 | + unset(self::$moveOutOfSharedFolder[$this->mountPoint.$path]); |
|
188 | 188 | } else { |
189 | 189 | $result = $this->doDelete($path, 'rmdir'); |
190 | 190 | } |
@@ -199,8 +199,8 @@ discard block |
||
199 | 199 | * @param $path |
200 | 200 | * @return bool |
201 | 201 | */ |
202 | - protected function shouldMoveToTrash($path){ |
|
203 | - $normalized = Filesystem::normalizePath($this->mountPoint . '/' . $path); |
|
202 | + protected function shouldMoveToTrash($path) { |
|
203 | + $normalized = Filesystem::normalizePath($this->mountPoint.'/'.$path); |
|
204 | 204 | $parts = explode('/', $normalized); |
205 | 205 | if (count($parts) < 4) { |
206 | 206 | return false; |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | return false; |
238 | 238 | } |
239 | 239 | |
240 | - $normalized = Filesystem::normalizePath($this->mountPoint . '/' . $path, true, false, true); |
|
240 | + $normalized = Filesystem::normalizePath($this->mountPoint.'/'.$path, true, false, true); |
|
241 | 241 | $result = true; |
242 | 242 | $view = Filesystem::getView(); |
243 | 243 | if (!isset($this->deletedFiles[$normalized]) && $view instanceof View) { |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | * Setup the storate wrapper callback |
266 | 266 | */ |
267 | 267 | public static function setupStorage() { |
268 | - \OC\Files\Filesystem::addStorageWrapper('oc_trashbin', function ($mountPoint, $storage) { |
|
268 | + \OC\Files\Filesystem::addStorageWrapper('oc_trashbin', function($mountPoint, $storage) { |
|
269 | 269 | return new \OCA\Files_Trashbin\Storage( |
270 | 270 | array('storage' => $storage, 'mountPoint' => $mountPoint), |
271 | 271 | \OC::$server->getUserManager(), |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $server->addPlugin(new \Sabre\DAV\Sync\Plugin()); |
85 | 85 | $server->addPlugin(new \Sabre\CalDAV\ICSExportPlugin()); |
86 | 86 | $server->addPlugin(new \OCA\DAV\CalDAV\Schedule\Plugin()); |
87 | -$server->addPlugin(new \OCA\DAV\CalDAV\Schedule\IMipPlugin( \OC::$server->getMailer(), \OC::$server->getLogger())); |
|
87 | +$server->addPlugin(new \OCA\DAV\CalDAV\Schedule\IMipPlugin(\OC::$server->getMailer(), \OC::$server->getLogger())); |
|
88 | 88 | $server->addPlugin(new ExceptionLoggerPlugin('caldav', \OC::$server->getLogger())); |
89 | 89 | |
90 | 90 | // And off we go! |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function check() { |
57 | 57 | // Look up the cache - it is invalidated all 30 minutes |
58 | - if (((int)$this->config->getAppValue('core', 'lastupdatedat') + 1800) > time()) { |
|
58 | + if (((int) $this->config->getAppValue('core', 'lastupdatedat') + 1800) > time()) { |
|
59 | 59 | return json_decode($this->config->getAppValue('core', 'lastupdateResult'), true); |
60 | 60 | } |
61 | 61 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $versionString = implode('x', $version); |
80 | 80 | |
81 | 81 | //fetch xml data from updater |
82 | - $url = $updaterUrl . '?version=' . $versionString; |
|
82 | + $url = $updaterUrl.'?version='.$versionString; |
|
83 | 83 | |
84 | 84 | $tmp = []; |
85 | 85 | try { |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | $data = @simplexml_load_string($xml); |
94 | 94 | libxml_disable_entity_loader($loadEntities); |
95 | 95 | if ($data !== false) { |
96 | - $tmp['version'] = (string)$data->version; |
|
97 | - $tmp['versionstring'] = (string)$data->versionstring; |
|
98 | - $tmp['url'] = (string)$data->url; |
|
99 | - $tmp['web'] = (string)$data->web; |
|
100 | - $tmp['autoupdater'] = (string)$data->autoupdater; |
|
96 | + $tmp['version'] = (string) $data->version; |
|
97 | + $tmp['versionstring'] = (string) $data->versionstring; |
|
98 | + $tmp['url'] = (string) $data->url; |
|
99 | + $tmp['web'] = (string) $data->web; |
|
100 | + $tmp['autoupdater'] = (string) $data->autoupdater; |
|
101 | 101 | } else { |
102 | 102 | libxml_clear_errors(); |
103 | 103 | } |
@@ -33,10 +33,10 @@ |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | public function setupDatabase($username) { |
36 | - $datadir = $this->config->getValue('datadirectory', \OC::$SERVERROOT . '/data'); |
|
36 | + $datadir = $this->config->getValue('datadirectory', \OC::$SERVERROOT.'/data'); |
|
37 | 37 | |
38 | 38 | //delete the old sqlite database first, might cause infinte loops otherwise |
39 | - if(file_exists("$datadir/owncloud.db")) { |
|
39 | + if (file_exists("$datadir/owncloud.db")) { |
|
40 | 40 | unlink("$datadir/owncloud.db"); |
41 | 41 | } |
42 | 42 | //in case of sqlite, we can always fill the database |