@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | $input = $host; |
| 62 | 62 | if (strpos($host, '://') === false) { |
| 63 | 63 | // add a protocol to fix parse_url behavior with ipv6 |
| 64 | - $host = 'http://' . $host; |
|
| 64 | + $host = 'http://'.$host; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | $parsed = parse_url($host); |
| 68 | - if(is_array($parsed) && isset($parsed['port'])) { |
|
| 68 | + if (is_array($parsed) && isset($parsed['port'])) { |
|
| 69 | 69 | return [$parsed['host'], $parsed['port']]; |
| 70 | 70 | } else if (is_array($parsed)) { |
| 71 | 71 | return [$parsed['host'], 22]; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | // Register sftp:// |
| 82 | 82 | Stream::register(); |
| 83 | 83 | |
| 84 | - $parsedHost = $this->splitHost($params['host']); |
|
| 84 | + $parsedHost = $this->splitHost($params['host']); |
|
| 85 | 85 | |
| 86 | 86 | $this->host = $parsedHost[0]; |
| 87 | 87 | $this->port = $parsedHost[1]; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | = isset($params['root']) ? $this->cleanPath($params['root']) : '/'; |
| 104 | 104 | |
| 105 | 105 | if ($this->root[0] !== '/') { |
| 106 | - $this->root = '/' . $this->root; |
|
| 106 | + $this->root = '/'.$this->root; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | if (substr($this->root, -1, 1) !== '/') { |
@@ -158,15 +158,15 @@ discard block |
||
| 158 | 158 | /** |
| 159 | 159 | * {@inheritdoc} |
| 160 | 160 | */ |
| 161 | - public function getId(){ |
|
| 162 | - $id = 'sftp::' . $this->user . '@' . $this->host; |
|
| 161 | + public function getId() { |
|
| 162 | + $id = 'sftp::'.$this->user.'@'.$this->host; |
|
| 163 | 163 | if ($this->port !== 22) { |
| 164 | - $id .= ':' . $this->port; |
|
| 164 | + $id .= ':'.$this->port; |
|
| 165 | 165 | } |
| 166 | 166 | // note: this will double the root slash, |
| 167 | 167 | // we should not change it to keep compatible with |
| 168 | 168 | // old storage ids |
| 169 | - $id .= '/' . $this->root; |
|
| 169 | + $id .= '/'.$this->root; |
|
| 170 | 170 | return $id; |
| 171 | 171 | } |
| 172 | 172 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | * @return string |
| 197 | 197 | */ |
| 198 | 198 | private function absPath($path) { |
| 199 | - return $this->root . $this->cleanPath($path); |
|
| 199 | + return $this->root.$this->cleanPath($path); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | /** |
@@ -206,8 +206,8 @@ discard block |
||
| 206 | 206 | try { |
| 207 | 207 | $storage_view = \OCP\Files::getStorage('files_external'); |
| 208 | 208 | if ($storage_view) { |
| 209 | - return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . |
|
| 210 | - $storage_view->getAbsolutePath('') . |
|
| 209 | + return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data'). |
|
| 210 | + $storage_view->getAbsolutePath(''). |
|
| 211 | 211 | 'ssh_hostKeys'; |
| 212 | 212 | } |
| 213 | 213 | } catch (\Exception $e) { |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | if ($keyPath && file_exists($keyPath)) { |
| 226 | 226 | $fp = fopen($keyPath, 'w'); |
| 227 | 227 | foreach ($keys as $host => $key) { |
| 228 | - fwrite($fp, $host . '::' . $key . "\n"); |
|
| 228 | + fwrite($fp, $host.'::'.$key."\n"); |
|
| 229 | 229 | } |
| 230 | 230 | fclose($fp); |
| 231 | 231 | return true; |
@@ -297,15 +297,15 @@ discard block |
||
| 297 | 297 | return false; |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | - $id = md5('sftp:' . $path); |
|
| 300 | + $id = md5('sftp:'.$path); |
|
| 301 | 301 | $dirStream = array(); |
| 302 | - foreach($list as $file) { |
|
| 302 | + foreach ($list as $file) { |
|
| 303 | 303 | if ($file !== '.' && $file !== '..') { |
| 304 | 304 | $dirStream[] = $file; |
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | 307 | return IteratorDirectory::wrap($dirStream); |
| 308 | - } catch(\Exception $e) { |
|
| 308 | + } catch (\Exception $e) { |
|
| 309 | 309 | return false; |
| 310 | 310 | } |
| 311 | 311 | } |
@@ -357,10 +357,10 @@ discard block |
||
| 357 | 357 | public function fopen($path, $mode) { |
| 358 | 358 | try { |
| 359 | 359 | $absPath = $this->absPath($path); |
| 360 | - switch($mode) { |
|
| 360 | + switch ($mode) { |
|
| 361 | 361 | case 'r': |
| 362 | 362 | case 'rb': |
| 363 | - if ( !$this->file_exists($path)) { |
|
| 363 | + if (!$this->file_exists($path)) { |
|
| 364 | 364 | return false; |
| 365 | 365 | } |
| 366 | 366 | case 'w': |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | /** |
| 388 | 388 | * {@inheritdoc} |
| 389 | 389 | */ |
| 390 | - public function touch($path, $mtime=null) { |
|
| 390 | + public function touch($path, $mtime = null) { |
|
| 391 | 391 | try { |
| 392 | 392 | if (!is_null($mtime)) { |
| 393 | 393 | return false; |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | // Do not pass the password here. We want to use the Net_SFTP object |
| 463 | 463 | // supplied via stream context or fail. We only supply username and |
| 464 | 464 | // hostname because this might show up in logs (they are not used). |
| 465 | - $url = 'sftp://' . urlencode($this->user) . '@' . $this->host . ':' . $this->port . $this->root . $path; |
|
| 465 | + $url = 'sftp://'.urlencode($this->user).'@'.$this->host.':'.$this->port.$this->root.$path; |
|
| 466 | 466 | return $url; |
| 467 | 467 | } |
| 468 | 468 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $json = file_get_contents('php://stdin'); |
| 113 | 113 | } else { |
| 114 | 114 | if (!file_exists($path)) { |
| 115 | - $output->writeln('<error>File not found: ' . $path . '</error>'); |
|
| 115 | + $output->writeln('<error>File not found: '.$path.'</error>'); |
|
| 116 | 116 | return 1; |
| 117 | 117 | } |
| 118 | 118 | $json = file_get_contents($path); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $existingMount->getApplicableUsers() === $mount->getApplicableUsers() && |
| 165 | 165 | $existingMount->getBackendOptions() === $mount->getBackendOptions() |
| 166 | 166 | ) { |
| 167 | - $output->writeln("<error>Duplicate mount (" . $mount->getMountPoint() . ")</error>"); |
|
| 167 | + $output->writeln("<error>Duplicate mount (".$mount->getMountPoint().")</error>"); |
|
| 168 | 168 | return 1; |
| 169 | 169 | } |
| 170 | 170 | } |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * listen to write event. |
| 55 | 55 | */ |
| 56 | - public static function write_hook( $params ) { |
|
| 56 | + public static function write_hook($params) { |
|
| 57 | 57 | |
| 58 | 58 | if (\OCP\App::isEnabled('files_versions')) { |
| 59 | 59 | $path = $params[\OC\Files\Filesystem::signal_param_path]; |
| 60 | - if($path !== '') { |
|
| 60 | + if ($path !== '') { |
|
| 61 | 61 | Storage::store($path); |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | if (\OCP\App::isEnabled('files_versions')) { |
| 77 | 77 | $path = $params[\OC\Files\Filesystem::signal_param_path]; |
| 78 | - if($path !== '') { |
|
| 78 | + if ($path !== '') { |
|
| 79 | 79 | Storage::delete($path); |
| 80 | 80 | } |
| 81 | 81 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public static function pre_remove_hook($params) { |
| 89 | 89 | $path = $params[\OC\Files\Filesystem::signal_param_path]; |
| 90 | - if($path !== '') { |
|
| 90 | + if ($path !== '') { |
|
| 91 | 91 | Storage::markDeletedFile($path); |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | if (\OCP\App::isEnabled('files_versions')) { |
| 105 | 105 | $oldpath = $params['oldpath']; |
| 106 | 106 | $newpath = $params['newpath']; |
| 107 | - if($oldpath !== '' && $newpath !== '') { |
|
| 107 | + if ($oldpath !== '' && $newpath !== '') { |
|
| 108 | 108 | Storage::renameOrCopy($oldpath, $newpath, 'rename'); |
| 109 | 109 | } |
| 110 | 110 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | if (\OCP\App::isEnabled('files_versions')) { |
| 123 | 123 | $oldpath = $params['oldpath']; |
| 124 | 124 | $newpath = $params['newpath']; |
| 125 | - if($oldpath !== '' && $newpath !== '') { |
|
| 125 | + if ($oldpath !== '' && $newpath !== '') { |
|
| 126 | 126 | Storage::renameOrCopy($oldpath, $newpath, 'copy'); |
| 127 | 127 | } |
| 128 | 128 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | // if we rename a movable mount point, then the versions don't have |
| 143 | 143 | // to be renamed |
| 144 | - $absOldPath = \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files' . $params['oldpath']); |
|
| 144 | + $absOldPath = \OC\Files\Filesystem::normalizePath('/'.\OCP\User::getUser().'/files'.$params['oldpath']); |
|
| 145 | 145 | $manager = \OC\Files\Filesystem::getMountManager(); |
| 146 | 146 | $mount = $manager->find($absOldPath); |
| 147 | 147 | $internalPath = $mount->getInternalPath($absOldPath); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | return; |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - $view = new \OC\Files\View(\OCP\User::getUser() . '/files'); |
|
| 152 | + $view = new \OC\Files\View(\OCP\User::getUser().'/files'); |
|
| 153 | 153 | if ($view->file_exists($params['newpath'])) { |
| 154 | 154 | Storage::store($params['newpath']); |
| 155 | 155 | } else { |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | OCP\User::checkLoggedIn(); |
| 32 | 32 | \OC::$server->getSession()->close(); |
| 33 | 33 | |
| 34 | -$files = isset($_GET['files']) ? (string)$_GET['files'] : ''; |
|
| 35 | -$dir = isset($_GET['dir']) ? (string)$_GET['dir'] : ''; |
|
| 34 | +$files = isset($_GET['files']) ? (string) $_GET['files'] : ''; |
|
| 35 | +$dir = isset($_GET['dir']) ? (string) $_GET['dir'] : ''; |
|
| 36 | 36 | |
| 37 | 37 | $files_list = json_decode($files); |
| 38 | 38 | // in case we get only a single file |
@@ -45,13 +45,13 @@ discard block |
||
| 45 | 45 | * the content must not be longer than 32 characters and must only contain |
| 46 | 46 | * alphanumeric characters |
| 47 | 47 | */ |
| 48 | -if(isset($_GET['downloadStartSecret']) |
|
| 48 | +if (isset($_GET['downloadStartSecret']) |
|
| 49 | 49 | && !isset($_GET['downloadStartSecret'][32]) |
| 50 | 50 | && preg_match('!^[a-zA-Z0-9]+$!', $_GET['downloadStartSecret']) === 1) { |
| 51 | 51 | setcookie('ocDownloadStarted', $_GET['downloadStartSecret'], time() + 20, '/'); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | -$server_params = array( 'head' => \OC::$server->getRequest()->getMethod() === 'HEAD' ); |
|
| 54 | +$server_params = array('head' => \OC::$server->getRequest()->getMethod() === 'HEAD'); |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Http range requests support |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | $basePath = $path; |
| 89 | 89 | |
| 90 | - if ($relativePath !== null && Filesystem::isReadable($basePath . $relativePath)) { |
|
| 90 | + if ($relativePath !== null && Filesystem::isReadable($basePath.$relativePath)) { |
|
| 91 | 91 | $path .= Filesystem::normalizePath($relativePath); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -112,14 +112,14 @@ discard block |
||
| 112 | 112 | if ($password !== null) { |
| 113 | 113 | if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK) { |
| 114 | 114 | if ($shareManager->checkPassword($share, $password)) { |
| 115 | - \OC::$server->getSession()->set('public_link_authenticated', (string)$share->getId()); |
|
| 115 | + \OC::$server->getSession()->set('public_link_authenticated', (string) $share->getId()); |
|
| 116 | 116 | return true; |
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | } else { |
| 120 | 120 | // not authenticated ? |
| 121 | 121 | if (\OC::$server->getSession()->exists('public_link_authenticated') |
| 122 | - && \OC::$server->getSession()->get('public_link_authenticated') !== (string)$share->getId()) { |
|
| 122 | + && \OC::$server->getSession()->get('public_link_authenticated') !== (string) $share->getId()) { |
|
| 123 | 123 | return true; |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | Filesystem::initMountPoints($owner); |
| 133 | 133 | $info = Filesystem::getFileInfo($target); |
| 134 | 134 | $ownerView = new View('/'.$owner.'/files'); |
| 135 | - if ( $owner !== User::getUser() ) { |
|
| 135 | + if ($owner !== User::getUser()) { |
|
| 136 | 136 | $path = $ownerView->getPath($info['fileid']); |
| 137 | 137 | } else { |
| 138 | 138 | $path = $target; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | if ($info instanceof \OC\Files\FileInfo) { |
| 146 | 146 | $ids[] = $info['fileid']; |
| 147 | 147 | } else { |
| 148 | - \OCP\Util::writeLog('sharing', 'No fileinfo available for: ' . $path, \OCP\Util::WARN); |
|
| 148 | + \OCP\Util::writeLog('sharing', 'No fileinfo available for: '.$path, \OCP\Util::WARN); |
|
| 149 | 149 | } |
| 150 | 150 | $path = dirname($path); |
| 151 | 151 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $idList = array_chunk($ids, 99, true); |
| 156 | 156 | |
| 157 | 157 | foreach ($idList as $subList) { |
| 158 | - $statement = "SELECT `share_with`, `share_type`, `file_target` FROM `*PREFIX*share` WHERE `file_source` IN (" . implode(',', $subList) . ") AND `share_type` IN (0, 1, 2)"; |
|
| 158 | + $statement = "SELECT `share_with`, `share_type`, `file_target` FROM `*PREFIX*share` WHERE `file_source` IN (".implode(',', $subList).") AND `share_type` IN (0, 1, 2)"; |
|
| 159 | 159 | $query = \OCP\DB::prepare($statement); |
| 160 | 160 | $r = $query->execute(); |
| 161 | 161 | $result = array_merge($result, $r->fetchAll()); |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $uid = User::getUser(); |
| 184 | 184 | } |
| 185 | 185 | Filesystem::initMountPoints($uid); |
| 186 | - if ( $uid !== User::getUser() ) { |
|
| 186 | + if ($uid !== User::getUser()) { |
|
| 187 | 187 | $info = Filesystem::getFileInfo($filename); |
| 188 | 188 | $ownerView = new View('/'.$uid.'/files'); |
| 189 | 189 | try { |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | $dir = $pathinfo['dirname']; |
| 231 | 231 | $i = 2; |
| 232 | 232 | while ($view->file_exists($path) || in_array($path, $excludeList)) { |
| 233 | - $path = Filesystem::normalizePath($dir . '/' . $name . ' ('.$i.')' . $ext); |
|
| 233 | + $path = Filesystem::normalizePath($dir.'/'.$name.' ('.$i.')'.$ext); |
|
| 234 | 234 | $i++; |
| 235 | 235 | } |
| 236 | 236 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | $dir = ''; |
| 255 | 255 | $subdirs = explode('/', $shareFolder); |
| 256 | 256 | foreach ($subdirs as $subdir) { |
| 257 | - $dir = $dir . '/' . $subdir; |
|
| 257 | + $dir = $dir.'/'.$subdir; |
|
| 258 | 258 | if (!$view->is_dir($dir)) { |
| 259 | 259 | $view->mkdir($dir); |
| 260 | 260 | } |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | |
| 69 | 69 | $query = $this->connection->getQueryBuilder(); |
| 70 | 70 | $query->update('share') |
| 71 | - ->set('share_type', $query->createNamedParameter(Share::SHARE_TYPE_GUEST)) |
|
| 71 | + ->set('share_type', $query->createNamedParameter(Share::SHARE_TYPE_GUEST)) |
|
| 72 | 72 | ->where($query->expr()->eq('share_type', $query->createNamedParameter(Share::SHARE_TYPE_EMAIL))); |
| 73 | 73 | $query->execute(); |
| 74 | 74 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | protected function execute(InputInterface $input, OutputInterface $output) { |
| 89 | 89 | |
| 90 | - if(\OC::checkUpgrade(false)) { |
|
| 90 | + if (\OC::checkUpgrade(false)) { |
|
| 91 | 91 | if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
| 92 | 92 | // Prepend each line with a little timestamp |
| 93 | 93 | $timestampFormatter = new TimestampFormatter($this->config, $output->getFormatter()); |
@@ -111,10 +111,10 @@ discard block |
||
| 111 | 111 | if ($event instanceof GenericEvent) { |
| 112 | 112 | $message = $event->getSubject(); |
| 113 | 113 | if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
| 114 | - $output->writeln(' Checking table ' . $message); |
|
| 114 | + $output->writeln(' Checking table '.$message); |
|
| 115 | 115 | } else { |
| 116 | 116 | if (strlen($message) > 60) { |
| 117 | - $message = substr($message, 0, 57) . '...'; |
|
| 117 | + $message = substr($message, 0, 57).'...'; |
|
| 118 | 118 | } |
| 119 | 119 | $progress->setMessage($message); |
| 120 | 120 | if ($event[0] === 1) { |
@@ -155,20 +155,20 @@ discard block |
||
| 155 | 155 | $output->writeln(''); |
| 156 | 156 | break; |
| 157 | 157 | case '\OC\Repair::step': |
| 158 | - if(OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
|
| 159 | - $output->writeln('<info>Repair step: ' . $event->getArgument(0) . '</info>'); |
|
| 158 | + if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
|
| 159 | + $output->writeln('<info>Repair step: '.$event->getArgument(0).'</info>'); |
|
| 160 | 160 | } |
| 161 | 161 | break; |
| 162 | 162 | case '\OC\Repair::info': |
| 163 | - if(OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
|
| 164 | - $output->writeln('<info>Repair info: ' . $event->getArgument(0) . '</info>'); |
|
| 163 | + if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
|
| 164 | + $output->writeln('<info>Repair info: '.$event->getArgument(0).'</info>'); |
|
| 165 | 165 | } |
| 166 | 166 | break; |
| 167 | 167 | case '\OC\Repair::warning': |
| 168 | - $output->writeln('<error>Repair warning: ' . $event->getArgument(0) . '</error>'); |
|
| 168 | + $output->writeln('<error>Repair warning: '.$event->getArgument(0).'</error>'); |
|
| 169 | 169 | break; |
| 170 | 170 | case '\OC\Repair::error': |
| 171 | - $output->writeln('<error>Repair error: ' . $event->getArgument(0) . '</error>'); |
|
| 171 | + $output->writeln('<error>Repair error: '.$event->getArgument(0).'</error>'); |
|
| 172 | 172 | break; |
| 173 | 173 | } |
| 174 | 174 | }; |
@@ -184,17 +184,17 @@ discard block |
||
| 184 | 184 | $dispatcher->addListener('\OC\Repair::error', $repairListener); |
| 185 | 185 | |
| 186 | 186 | |
| 187 | - $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use($output) { |
|
| 187 | + $updater->listen('\OC\Updater', 'maintenanceEnabled', function() use($output) { |
|
| 188 | 188 | $output->writeln('<info>Turned on maintenance mode</info>'); |
| 189 | 189 | }); |
| 190 | - $updater->listen('\OC\Updater', 'maintenanceDisabled', function () use($output) { |
|
| 190 | + $updater->listen('\OC\Updater', 'maintenanceDisabled', function() use($output) { |
|
| 191 | 191 | $output->writeln('<info>Turned off maintenance mode</info>'); |
| 192 | 192 | }); |
| 193 | - $updater->listen('\OC\Updater', 'maintenanceActive', function () use($output) { |
|
| 193 | + $updater->listen('\OC\Updater', 'maintenanceActive', function() use($output) { |
|
| 194 | 194 | $output->writeln('<info>Maintenance mode is kept active</info>'); |
| 195 | 195 | }); |
| 196 | 196 | $updater->listen('\OC\Updater', 'updateEnd', |
| 197 | - function ($success) use($output, $self) { |
|
| 197 | + function($success) use($output, $self) { |
|
| 198 | 198 | if ($success) { |
| 199 | 199 | $message = "<info>Update successful</info>"; |
| 200 | 200 | } else { |
@@ -202,61 +202,61 @@ discard block |
||
| 202 | 202 | } |
| 203 | 203 | $output->writeln($message); |
| 204 | 204 | }); |
| 205 | - $updater->listen('\OC\Updater', 'dbUpgradeBefore', function () use($output) { |
|
| 205 | + $updater->listen('\OC\Updater', 'dbUpgradeBefore', function() use($output) { |
|
| 206 | 206 | $output->writeln('<info>Updating database schema</info>'); |
| 207 | 207 | }); |
| 208 | - $updater->listen('\OC\Updater', 'dbUpgrade', function () use($output) { |
|
| 208 | + $updater->listen('\OC\Updater', 'dbUpgrade', function() use($output) { |
|
| 209 | 209 | $output->writeln('<info>Updated database</info>'); |
| 210 | 210 | }); |
| 211 | - $updater->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function () use($output) { |
|
| 211 | + $updater->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function() use($output) { |
|
| 212 | 212 | $output->writeln('<info>Checking whether the database schema can be updated (this can take a long time depending on the database size)</info>'); |
| 213 | 213 | }); |
| 214 | - $updater->listen('\OC\Updater', 'dbSimulateUpgrade', function () use($output) { |
|
| 214 | + $updater->listen('\OC\Updater', 'dbSimulateUpgrade', function() use($output) { |
|
| 215 | 215 | $output->writeln('<info>Checked database schema update</info>'); |
| 216 | 216 | }); |
| 217 | - $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use($output) { |
|
| 218 | - $output->writeln('<comment>Disabled incompatible app: ' . $app . '</comment>'); |
|
| 217 | + $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function($app) use($output) { |
|
| 218 | + $output->writeln('<comment>Disabled incompatible app: '.$app.'</comment>'); |
|
| 219 | 219 | }); |
| 220 | - $updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function ($app) use ($output) { |
|
| 221 | - $output->writeln('<comment>Disabled 3rd-party app: ' . $app . '</comment>'); |
|
| 220 | + $updater->listen('\OC\Updater', 'thirdPartyAppDisabled', function($app) use ($output) { |
|
| 221 | + $output->writeln('<comment>Disabled 3rd-party app: '.$app.'</comment>'); |
|
| 222 | 222 | }); |
| 223 | - $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use($output) { |
|
| 224 | - $output->writeln('<info>Checking for update of app ' . $app . ' in appstore</info>'); |
|
| 223 | + $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function($app) use($output) { |
|
| 224 | + $output->writeln('<info>Checking for update of app '.$app.' in appstore</info>'); |
|
| 225 | 225 | }); |
| 226 | - $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use($output) { |
|
| 227 | - $output->writeln('<info>Update app ' . $app . ' from appstore</info>'); |
|
| 226 | + $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function($app) use($output) { |
|
| 227 | + $output->writeln('<info>Update app '.$app.' from appstore</info>'); |
|
| 228 | 228 | }); |
| 229 | - $updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use($output) { |
|
| 230 | - $output->writeln('<info>Checked for update of app "' . $app . '" in appstore </info>'); |
|
| 229 | + $updater->listen('\OC\Updater', 'checkAppStoreApp', function($app) use($output) { |
|
| 230 | + $output->writeln('<info>Checked for update of app "'.$app.'" in appstore </info>'); |
|
| 231 | 231 | }); |
| 232 | - $updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($output) { |
|
| 232 | + $updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function() use ($output) { |
|
| 233 | 233 | $output->writeln('<info>Checking updates of apps</info>'); |
| 234 | 234 | }); |
| 235 | - $updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($output) { |
|
| 235 | + $updater->listen('\OC\Updater', 'appSimulateUpdate', function($app) use ($output) { |
|
| 236 | 236 | $output->writeln("<info>Checking whether the database schema for <$app> can be updated (this can take a long time depending on the database size)</info>"); |
| 237 | 237 | }); |
| 238 | - $updater->listen('\OC\Updater', 'appUpgradeCheck', function () use ($output) { |
|
| 238 | + $updater->listen('\OC\Updater', 'appUpgradeCheck', function() use ($output) { |
|
| 239 | 239 | $output->writeln('<info>Checked database schema update for apps</info>'); |
| 240 | 240 | }); |
| 241 | - $updater->listen('\OC\Updater', 'appUpgradeStarted', function ($app, $version) use ($output) { |
|
| 241 | + $updater->listen('\OC\Updater', 'appUpgradeStarted', function($app, $version) use ($output) { |
|
| 242 | 242 | $output->writeln("<info>Updating <$app> ...</info>"); |
| 243 | 243 | }); |
| 244 | - $updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($output) { |
|
| 244 | + $updater->listen('\OC\Updater', 'appUpgrade', function($app, $version) use ($output) { |
|
| 245 | 245 | $output->writeln("<info>Updated <$app> to $version</info>"); |
| 246 | 246 | }); |
| 247 | - $updater->listen('\OC\Updater', 'failure', function ($message) use($output, $self) { |
|
| 247 | + $updater->listen('\OC\Updater', 'failure', function($message) use($output, $self) { |
|
| 248 | 248 | $output->writeln("<error>$message</error>"); |
| 249 | 249 | }); |
| 250 | - $updater->listen('\OC\Updater', 'setDebugLogLevel', function ($logLevel, $logLevelName) use($output) { |
|
| 250 | + $updater->listen('\OC\Updater', 'setDebugLogLevel', function($logLevel, $logLevelName) use($output) { |
|
| 251 | 251 | $output->writeln("<info>Set log level to debug</info>"); |
| 252 | 252 | }); |
| 253 | - $updater->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use($output) { |
|
| 253 | + $updater->listen('\OC\Updater', 'resetLogLevel', function($logLevel, $logLevelName) use($output) { |
|
| 254 | 254 | $output->writeln("<info>Reset log level</info>"); |
| 255 | 255 | }); |
| 256 | - $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use($output) { |
|
| 256 | + $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function() use($output) { |
|
| 257 | 257 | $output->writeln("<info>Starting code integrity check...</info>"); |
| 258 | 258 | }); |
| 259 | - $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use($output) { |
|
| 259 | + $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function() use($output) { |
|
| 260 | 260 | $output->writeln("<info>Finished code integrity check</info>"); |
| 261 | 261 | }); |
| 262 | 262 | |
@@ -264,12 +264,12 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | $this->postUpgradeCheck($input, $output); |
| 266 | 266 | |
| 267 | - if(!$success) { |
|
| 267 | + if (!$success) { |
|
| 268 | 268 | return self::ERROR_FAILURE; |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | return self::ERROR_SUCCESS; |
| 272 | - } else if($this->config->getSystemValue('maintenance', false)) { |
|
| 272 | + } else if ($this->config->getSystemValue('maintenance', false)) { |
|
| 273 | 273 | //Possible scenario: Nextcloud core is updated but an app failed |
| 274 | 274 | $output->writeln('<warning>Nextcloud is in maintenance mode</warning>'); |
| 275 | 275 | $output->write('<comment>Maybe an upgrade is already in process. Please check the ' |
@@ -294,8 +294,8 @@ discard block |
||
| 294 | 294 | $trustedDomains = $this->config->getSystemValue('trusted_domains', array()); |
| 295 | 295 | if (empty($trustedDomains)) { |
| 296 | 296 | $output->write( |
| 297 | - '<warning>The setting "trusted_domains" could not be ' . |
|
| 298 | - 'set automatically by the upgrade script, ' . |
|
| 297 | + '<warning>The setting "trusted_domains" could not be '. |
|
| 298 | + 'set automatically by the upgrade script, '. |
|
| 299 | 299 | 'please set it manually</warning>' |
| 300 | 300 | ); |
| 301 | 301 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * ubos-raspberry-pi.local and ubos-raspberry-pi-2.local |
| 68 | 68 | */ |
| 69 | 69 | 'trusted_domains' => |
| 70 | - array ( |
|
| 70 | + array( |
|
| 71 | 71 | 'demo.example.org', |
| 72 | 72 | 'otherdomain.example.org', |
| 73 | 73 | ), |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | * |
| 193 | 193 | * Defaults to ``60*60*24*15`` seconds (15 days) |
| 194 | 194 | */ |
| 195 | -'remember_login_cookie_lifetime' => 60*60*24*15, |
|
| 195 | +'remember_login_cookie_lifetime' => 60 * 60 * 24 * 15, |
|
| 196 | 196 | |
| 197 | 197 | /** |
| 198 | 198 | * The lifetime of a session after inactivity. |
@@ -1074,7 +1074,7 @@ discard block |
||
| 1074 | 1074 | * See https://redis.io/topics/cluster-spec for details about the Redis cluster |
| 1075 | 1075 | */ |
| 1076 | 1076 | 'redis.cluster' => [ |
| 1077 | - 'seeds' => [ // provide some/all of the cluster servers to bootstrap discovery, port required |
|
| 1077 | + 'seeds' => [// provide some/all of the cluster servers to bootstrap discovery, port required |
|
| 1078 | 1078 | 'localhost:7000', |
| 1079 | 1079 | 'localhost:7001' |
| 1080 | 1080 | ], |
@@ -1138,7 +1138,7 @@ discard block |
||
| 1138 | 1138 | * |
| 1139 | 1139 | * Defaults to ``60*60*24`` (1 day) |
| 1140 | 1140 | */ |
| 1141 | -'cache_chunk_gc_ttl' => 60*60*24, |
|
| 1141 | +'cache_chunk_gc_ttl' => 60 * 60 * 24, |
|
| 1142 | 1142 | |
| 1143 | 1143 | /** |
| 1144 | 1144 | * Using Object Store with Nextcloud |
@@ -1462,7 +1462,7 @@ discard block |
||
| 1462 | 1462 | * Defaults to ``60*60`` seconds (1 hour) or the php |
| 1463 | 1463 | * max_execution_time, whichever is higher. |
| 1464 | 1464 | */ |
| 1465 | -'filelocking.ttl' => 60*60, |
|
| 1465 | +'filelocking.ttl' => 60 * 60, |
|
| 1466 | 1466 | |
| 1467 | 1467 | /** |
| 1468 | 1468 | * Memory caching backend for file locking |
@@ -169,8 +169,8 @@ |
||
| 169 | 169 | 'mimetype', $update->createNamedParameter($folderMimeTypeId) |
| 170 | 170 | )) |
| 171 | 171 | ->andWhere($update->expr()->like( |
| 172 | - $update->createFunction('LOWER(' . $update->getColumnName('name') . ')'), |
|
| 173 | - $update->createNamedParameter('%' . $this->dbConnection->escapeLikeParameter('.' . $ext)) |
|
| 172 | + $update->createFunction('LOWER('.$update->getColumnName('name').')'), |
|
| 173 | + $update->createNamedParameter('%'.$this->dbConnection->escapeLikeParameter('.'.$ext)) |
|
| 174 | 174 | )); |
| 175 | 175 | return $update->execute(); |
| 176 | 176 | } |