@@ -63,9 +63,9 @@ discard block |
||
| 63 | 63 | //use the admin login data for the new database user |
| 64 | 64 | |
| 65 | 65 | //add prefix to the postgresql user name to prevent collisions |
| 66 | - $this->dbUser = 'oc_' . strtolower($username); |
|
| 66 | + $this->dbUser = 'oc_'.strtolower($username); |
|
| 67 | 67 | //create a new password so we don't need to store the admin config in the config file |
| 68 | - $this->dbPassword = \OC::$server->getSecureRandom()->generate(30, \OCP\Security\ISecureRandom::CHAR_LOWER . \OCP\Security\ISecureRandom::CHAR_DIGITS); |
|
| 68 | + $this->dbPassword = \OC::$server->getSecureRandom()->generate(30, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS); |
|
| 69 | 69 | |
| 70 | 70 | $this->createDBUser($connection); |
| 71 | 71 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | //create the database |
| 79 | 79 | $this->createDatabase($connection); |
| 80 | 80 | $query = $connection->prepare("select count(*) FROM pg_class WHERE relname=? limit 1"); |
| 81 | - $query->execute([$this->tablePrefix . "users"]); |
|
| 81 | + $query->execute([$this->tablePrefix."users"]); |
|
| 82 | 82 | $tablesSetup = $query->fetchColumn() > 0; |
| 83 | 83 | |
| 84 | 84 | // the connection to dbname=postgres is not needed anymore |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | private function createDatabase(IDBConnection $connection) { |
| 110 | 110 | if (!$this->databaseExists($connection)) { |
| 111 | 111 | //The database does not exists... let's create it |
| 112 | - $query = $connection->prepare("CREATE DATABASE " . addslashes($this->dbName) . " OWNER " . addslashes($this->dbUser)); |
|
| 112 | + $query = $connection->prepare("CREATE DATABASE ".addslashes($this->dbName)." OWNER ".addslashes($this->dbUser)); |
|
| 113 | 113 | try { |
| 114 | 114 | $query->execute(); |
| 115 | 115 | } catch (DatabaseException $e) { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $this->logger->logException($e); |
| 118 | 118 | } |
| 119 | 119 | } else { |
| 120 | - $query = $connection->prepare("REVOKE ALL PRIVILEGES ON DATABASE " . addslashes($this->dbName) . " FROM PUBLIC"); |
|
| 120 | + $query = $connection->prepare("REVOKE ALL PRIVILEGES ON DATABASE ".addslashes($this->dbName)." FROM PUBLIC"); |
|
| 121 | 121 | try { |
| 122 | 122 | $query->execute(); |
| 123 | 123 | } catch (DatabaseException $e) { |
@@ -153,11 +153,11 @@ discard block |
||
| 153 | 153 | $i = 1; |
| 154 | 154 | while ($this->userExists($connection)) { |
| 155 | 155 | $i++; |
| 156 | - $this->dbUser = $dbUser . $i; |
|
| 156 | + $this->dbUser = $dbUser.$i; |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | // create the user |
| 160 | - $query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'"); |
|
| 160 | + $query = $connection->prepare("CREATE USER ".addslashes($this->dbUser)." CREATEDB PASSWORD '".addslashes($this->dbPassword)."'"); |
|
| 161 | 161 | $query->execute(); |
| 162 | 162 | } catch (DatabaseException $e) { |
| 163 | 163 | $this->logger->error('Error while trying to create database user'); |
@@ -56,8 +56,8 @@ |
||
| 56 | 56 | */ |
| 57 | 57 | public function postConnect(ConnectionEventArgs $args) { |
| 58 | 58 | $sensitive = $this->caseSensitiveLike ? 'true' : 'false'; |
| 59 | - $args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = ' . $sensitive); |
|
| 60 | - $args->getConnection()->executeUpdate('PRAGMA journal_mode = ' . $this->journalMode); |
|
| 59 | + $args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = '.$sensitive); |
|
| 60 | + $args->getConnection()->executeUpdate('PRAGMA journal_mode = '.$this->journalMode); |
|
| 61 | 61 | /** @var \PDO $pdo */ |
| 62 | 62 | $pdo = $args->getConnection()->getWrappedConnection(); |
| 63 | 63 | $pdo->sqliteCreateFunction('md5', 'md5', 1); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function widthTopLeft() { |
| 135 | 135 | $o = $this->getOrientation(); |
| 136 | - $this->logger->debug('OC_Image->widthTopLeft() Orientation: ' . $o, array('app' => 'core')); |
|
| 136 | + $this->logger->debug('OC_Image->widthTopLeft() Orientation: '.$o, array('app' => 'core')); |
|
| 137 | 137 | switch ($o) { |
| 138 | 138 | case -1: |
| 139 | 139 | case 1: |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public function heightTopLeft() { |
| 159 | 159 | $o = $this->getOrientation(); |
| 160 | - $this->logger->debug('OC_Image->heightTopLeft() Orientation: ' . $o, array('app' => 'core')); |
|
| 160 | + $this->logger->debug('OC_Image->heightTopLeft() Orientation: '.$o, array('app' => 'core')); |
|
| 161 | 161 | switch ($o) { |
| 162 | 162 | case -1: |
| 163 | 163 | case 1: |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | if ($mimeType === null) { |
| 185 | 185 | $mimeType = $this->mimeType(); |
| 186 | 186 | } |
| 187 | - header('Content-Type: ' . $mimeType); |
|
| 187 | + header('Content-Type: '.$mimeType); |
|
| 188 | 188 | return $this->_output(null, $mimeType); |
| 189 | 189 | } |
| 190 | 190 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | } |
| 203 | 203 | if ($filePath === null) { |
| 204 | 204 | if ($this->filePath === null) { |
| 205 | - $this->logger->error(__METHOD__ . '(): called with no path.', array('app' => 'core')); |
|
| 205 | + $this->logger->error(__METHOD__.'(): called with no path.', array('app' => 'core')); |
|
| 206 | 206 | return false; |
| 207 | 207 | } else { |
| 208 | 208 | $filePath = $this->filePath; |
@@ -226,10 +226,10 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | $isWritable = is_writable(dirname($filePath)); |
| 228 | 228 | if (!$isWritable) { |
| 229 | - $this->logger->error(__METHOD__ . '(): Directory \'' . dirname($filePath) . '\' is not writable.', array('app' => 'core')); |
|
| 229 | + $this->logger->error(__METHOD__.'(): Directory \''.dirname($filePath).'\' is not writable.', array('app' => 'core')); |
|
| 230 | 230 | return false; |
| 231 | 231 | } elseif ($isWritable && file_exists($filePath) && !is_writable($filePath)) { |
| 232 | - $this->logger->error(__METHOD__ . '(): File \'' . $filePath . '\' is not writable.', array('app' => 'core')); |
|
| 232 | + $this->logger->error(__METHOD__.'(): File \''.$filePath.'\' is not writable.', array('app' => 'core')); |
|
| 233 | 233 | return false; |
| 234 | 234 | } |
| 235 | 235 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | $imageType = IMAGETYPE_BMP; |
| 258 | 258 | break; |
| 259 | 259 | default: |
| 260 | - throw new Exception('\OC_Image::_output(): "' . $mimeType . '" is not supported when forcing a specific output format'); |
|
| 260 | + throw new Exception('\OC_Image::_output(): "'.$mimeType.'" is not supported when forcing a specific output format'); |
|
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | return; |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | - $exif = @exif_read_data('data://image/jpeg;base64,' . base64_encode($data)); |
|
| 439 | + $exif = @exif_read_data('data://image/jpeg;base64,'.base64_encode($data)); |
|
| 440 | 440 | if (!$exif) { |
| 441 | 441 | return; |
| 442 | 442 | } |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | */ |
| 455 | 455 | public function fixOrientation() { |
| 456 | 456 | $o = $this->getOrientation(); |
| 457 | - $this->logger->debug('OC_Image->fixOrientation() Orientation: ' . $o, array('app' => 'core')); |
|
| 457 | + $this->logger->debug('OC_Image->fixOrientation() Orientation: '.$o, array('app' => 'core')); |
|
| 458 | 458 | $rotate = 0; |
| 459 | 459 | $flip = false; |
| 460 | 460 | switch ($o) { |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | $rotate = 90; |
| 490 | 490 | break; |
| 491 | 491 | } |
| 492 | - if($flip && function_exists('imageflip')) { |
|
| 492 | + if ($flip && function_exists('imageflip')) { |
|
| 493 | 493 | imageflip($this->resource, IMG_FLIP_HORIZONTAL); |
| 494 | 494 | } |
| 495 | 495 | if ($rotate) { |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | imagealphablending($this->resource, true); |
| 552 | 552 | imagesavealpha($this->resource, true); |
| 553 | 553 | } else { |
| 554 | - $this->logger->debug('OC_Image->loadFromFile, GIF images not supported: ' . $imagePath, array('app' => 'core')); |
|
| 554 | + $this->logger->debug('OC_Image->loadFromFile, GIF images not supported: '.$imagePath, array('app' => 'core')); |
|
| 555 | 555 | } |
| 556 | 556 | break; |
| 557 | 557 | case IMAGETYPE_JPEG: |
@@ -559,10 +559,10 @@ discard block |
||
| 559 | 559 | if (getimagesize($imagePath) !== false) { |
| 560 | 560 | $this->resource = @imagecreatefromjpeg($imagePath); |
| 561 | 561 | } else { |
| 562 | - $this->logger->debug('OC_Image->loadFromFile, JPG image not valid: ' . $imagePath, array('app' => 'core')); |
|
| 562 | + $this->logger->debug('OC_Image->loadFromFile, JPG image not valid: '.$imagePath, array('app' => 'core')); |
|
| 563 | 563 | } |
| 564 | 564 | } else { |
| 565 | - $this->logger->debug('OC_Image->loadFromFile, JPG images not supported: ' . $imagePath, array('app' => 'core')); |
|
| 565 | + $this->logger->debug('OC_Image->loadFromFile, JPG images not supported: '.$imagePath, array('app' => 'core')); |
|
| 566 | 566 | } |
| 567 | 567 | break; |
| 568 | 568 | case IMAGETYPE_PNG: |
@@ -572,21 +572,21 @@ discard block |
||
| 572 | 572 | imagealphablending($this->resource, true); |
| 573 | 573 | imagesavealpha($this->resource, true); |
| 574 | 574 | } else { |
| 575 | - $this->logger->debug('OC_Image->loadFromFile, PNG images not supported: ' . $imagePath, array('app' => 'core')); |
|
| 575 | + $this->logger->debug('OC_Image->loadFromFile, PNG images not supported: '.$imagePath, array('app' => 'core')); |
|
| 576 | 576 | } |
| 577 | 577 | break; |
| 578 | 578 | case IMAGETYPE_XBM: |
| 579 | 579 | if (imagetypes() & IMG_XPM) { |
| 580 | 580 | $this->resource = @imagecreatefromxbm($imagePath); |
| 581 | 581 | } else { |
| 582 | - $this->logger->debug('OC_Image->loadFromFile, XBM/XPM images not supported: ' . $imagePath, array('app' => 'core')); |
|
| 582 | + $this->logger->debug('OC_Image->loadFromFile, XBM/XPM images not supported: '.$imagePath, array('app' => 'core')); |
|
| 583 | 583 | } |
| 584 | 584 | break; |
| 585 | 585 | case IMAGETYPE_WBMP: |
| 586 | 586 | if (imagetypes() & IMG_WBMP) { |
| 587 | 587 | $this->resource = @imagecreatefromwbmp($imagePath); |
| 588 | 588 | } else { |
| 589 | - $this->logger->debug('OC_Image->loadFromFile, WBMP images not supported: ' . $imagePath, array('app' => 'core')); |
|
| 589 | + $this->logger->debug('OC_Image->loadFromFile, WBMP images not supported: '.$imagePath, array('app' => 'core')); |
|
| 590 | 590 | } |
| 591 | 591 | break; |
| 592 | 592 | case IMAGETYPE_BMP: |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | */ |
| 697 | 697 | private function imagecreatefrombmp($fileName) { |
| 698 | 698 | if (!($fh = fopen($fileName, 'rb'))) { |
| 699 | - $this->logger->warning('imagecreatefrombmp: Can not open ' . $fileName, array('app' => 'core')); |
|
| 699 | + $this->logger->warning('imagecreatefrombmp: Can not open '.$fileName, array('app' => 'core')); |
|
| 700 | 700 | return false; |
| 701 | 701 | } |
| 702 | 702 | // read file header |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | // check for bitmap |
| 705 | 705 | if ($meta['type'] != 19778) { |
| 706 | 706 | fclose($fh); |
| 707 | - $this->logger->warning('imagecreatefrombmp: Can not open ' . $fileName . ' is not a bitmap!', array('app' => 'core')); |
|
| 707 | + $this->logger->warning('imagecreatefrombmp: Can not open '.$fileName.' is not a bitmap!', array('app' => 'core')); |
|
| 708 | 708 | return false; |
| 709 | 709 | } |
| 710 | 710 | // read image header |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | $meta['imagesize'] = @filesize($fileName) - $meta['offset']; |
| 729 | 729 | if ($meta['imagesize'] < 1) { |
| 730 | 730 | fclose($fh); |
| 731 | - $this->logger->warning('imagecreatefrombmp: Can not obtain file size of ' . $fileName . ' is not a bitmap!', array('app' => 'core')); |
|
| 731 | + $this->logger->warning('imagecreatefrombmp: Can not obtain file size of '.$fileName.' is not a bitmap!', array('app' => 'core')); |
|
| 732 | 732 | return false; |
| 733 | 733 | } |
| 734 | 734 | } |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | // read color palette |
| 739 | 739 | $palette = array(); |
| 740 | 740 | if ($meta['bits'] < 16) { |
| 741 | - $palette = unpack('l' . $meta['colors'], fread($fh, $meta['colors'] * 4)); |
|
| 741 | + $palette = unpack('l'.$meta['colors'], fread($fh, $meta['colors'] * 4)); |
|
| 742 | 742 | // in rare cases the color value is signed |
| 743 | 743 | if ($palette[1] < 0) { |
| 744 | 744 | foreach ($palette as $i => $color) { |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | if ($im == false) { |
| 752 | 752 | fclose($fh); |
| 753 | 753 | $this->logger->warning( |
| 754 | - 'imagecreatefrombmp: imagecreatetruecolor failed for file "' . $fileName . '" with dimensions ' . $meta['width'] . 'x' . $meta['height'], |
|
| 754 | + 'imagecreatefrombmp: imagecreatetruecolor failed for file "'.$fileName.'" with dimensions '.$meta['width'].'x'.$meta['height'], |
|
| 755 | 755 | array('app' => 'core')); |
| 756 | 756 | return false; |
| 757 | 757 | } |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | $p = 0; |
| 761 | 761 | $vide = chr(0); |
| 762 | 762 | $y = $meta['height'] - 1; |
| 763 | - $error = 'imagecreatefrombmp: ' . $fileName . ' has not enough data!'; |
|
| 763 | + $error = 'imagecreatefrombmp: '.$fileName.' has not enough data!'; |
|
| 764 | 764 | // loop through the image data beginning with the lower left corner |
| 765 | 765 | while ($y >= 0) { |
| 766 | 766 | $x = 0; |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | $this->logger->warning($error, array('app' => 'core')); |
| 773 | 773 | return $im; |
| 774 | 774 | } |
| 775 | - $color = @unpack('V', $part . $vide); |
|
| 775 | + $color = @unpack('V', $part.$vide); |
|
| 776 | 776 | break; |
| 777 | 777 | case 16: |
| 778 | 778 | if (!($part = substr($data, $p, 2))) { |
@@ -784,16 +784,16 @@ discard block |
||
| 784 | 784 | $color[1] = (($color[1] & 0xf800) >> 8) * 65536 + (($color[1] & 0x07e0) >> 3) * 256 + (($color[1] & 0x001f) << 3); |
| 785 | 785 | break; |
| 786 | 786 | case 8: |
| 787 | - $color = @unpack('n', $vide . ($data[$p] ?? '')); |
|
| 787 | + $color = @unpack('n', $vide.($data[$p] ?? '')); |
|
| 788 | 788 | $color[1] = isset($palette[$color[1] + 1]) ? $palette[$color[1] + 1] : $palette[1]; |
| 789 | 789 | break; |
| 790 | 790 | case 4: |
| 791 | - $color = @unpack('n', $vide . ($data[floor($p)] ?? '')); |
|
| 791 | + $color = @unpack('n', $vide.($data[floor($p)] ?? '')); |
|
| 792 | 792 | $color[1] = ($p * 2) % 2 == 0 ? $color[1] >> 4 : $color[1] & 0x0F; |
| 793 | 793 | $color[1] = isset($palette[$color[1] + 1]) ? $palette[$color[1] + 1] : $palette[1]; |
| 794 | 794 | break; |
| 795 | 795 | case 1: |
| 796 | - $color = @unpack('n', $vide . ($data[floor($p)] ?? '')); |
|
| 796 | + $color = @unpack('n', $vide.($data[floor($p)] ?? '')); |
|
| 797 | 797 | switch (($p * 8) % 8) { |
| 798 | 798 | case 0: |
| 799 | 799 | $color[1] = $color[1] >> 7; |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | break; |
| 825 | 825 | default: |
| 826 | 826 | fclose($fh); |
| 827 | - $this->logger->warning('imagecreatefrombmp: ' . $fileName . ' has ' . $meta['bits'] . ' bits and this is not supported!', array('app' => 'core')); |
|
| 827 | + $this->logger->warning('imagecreatefrombmp: '.$fileName.' has '.$meta['bits'].' bits and this is not supported!', array('app' => 'core')); |
|
| 828 | 828 | return false; |
| 829 | 829 | } |
| 830 | 830 | imagesetpixel($im, $x, $y, $color[1]); |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | */ |
| 847 | 847 | public function resize($maxSize) { |
| 848 | 848 | if (!$this->valid()) { |
| 849 | - $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core')); |
|
| 849 | + $this->logger->error(__METHOD__.'(): No image loaded', array('app' => 'core')); |
|
| 850 | 850 | return false; |
| 851 | 851 | } |
| 852 | 852 | $widthOrig = imagesx($this->resource); |
@@ -861,7 +861,7 @@ discard block |
||
| 861 | 861 | $newHeight = $maxSize; |
| 862 | 862 | } |
| 863 | 863 | |
| 864 | - $this->preciseResize((int)round($newWidth), (int)round($newHeight)); |
|
| 864 | + $this->preciseResize((int) round($newWidth), (int) round($newHeight)); |
|
| 865 | 865 | return true; |
| 866 | 866 | } |
| 867 | 867 | |
@@ -872,7 +872,7 @@ discard block |
||
| 872 | 872 | */ |
| 873 | 873 | public function preciseResize(int $width, int $height): bool { |
| 874 | 874 | if (!$this->valid()) { |
| 875 | - $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core')); |
|
| 875 | + $this->logger->error(__METHOD__.'(): No image loaded', array('app' => 'core')); |
|
| 876 | 876 | return false; |
| 877 | 877 | } |
| 878 | 878 | $widthOrig = imagesx($this->resource); |
@@ -880,7 +880,7 @@ discard block |
||
| 880 | 880 | $process = imagecreatetruecolor($width, $height); |
| 881 | 881 | |
| 882 | 882 | if ($process == false) { |
| 883 | - $this->logger->error(__METHOD__ . '(): Error creating true color image', array('app' => 'core')); |
|
| 883 | + $this->logger->error(__METHOD__.'(): Error creating true color image', array('app' => 'core')); |
|
| 884 | 884 | imagedestroy($process); |
| 885 | 885 | return false; |
| 886 | 886 | } |
@@ -894,7 +894,7 @@ discard block |
||
| 894 | 894 | |
| 895 | 895 | imagecopyresampled($process, $this->resource, 0, 0, 0, 0, $width, $height, $widthOrig, $heightOrig); |
| 896 | 896 | if ($process == false) { |
| 897 | - $this->logger->error(__METHOD__ . '(): Error re-sampling process image', array('app' => 'core')); |
|
| 897 | + $this->logger->error(__METHOD__.'(): Error re-sampling process image', array('app' => 'core')); |
|
| 898 | 898 | imagedestroy($process); |
| 899 | 899 | return false; |
| 900 | 900 | } |
@@ -952,7 +952,7 @@ discard block |
||
| 952 | 952 | |
| 953 | 953 | imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $targetWidth, $targetHeight, $width, $height); |
| 954 | 954 | if ($process == false) { |
| 955 | - $this->logger->error('OC_Image->centerCrop, Error re-sampling process image ' . $width . 'x' . $height, array('app' => 'core')); |
|
| 955 | + $this->logger->error('OC_Image->centerCrop, Error re-sampling process image '.$width.'x'.$height, array('app' => 'core')); |
|
| 956 | 956 | imagedestroy($process); |
| 957 | 957 | return false; |
| 958 | 958 | } |
@@ -972,12 +972,12 @@ discard block |
||
| 972 | 972 | */ |
| 973 | 973 | public function crop(int $x, int $y, int $w, int $h): bool { |
| 974 | 974 | if (!$this->valid()) { |
| 975 | - $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core')); |
|
| 975 | + $this->logger->error(__METHOD__.'(): No image loaded', array('app' => 'core')); |
|
| 976 | 976 | return false; |
| 977 | 977 | } |
| 978 | 978 | $process = imagecreatetruecolor($w, $h); |
| 979 | 979 | if ($process == false) { |
| 980 | - $this->logger->error(__METHOD__ . '(): Error creating true color image', array('app' => 'core')); |
|
| 980 | + $this->logger->error(__METHOD__.'(): Error creating true color image', array('app' => 'core')); |
|
| 981 | 981 | imagedestroy($process); |
| 982 | 982 | return false; |
| 983 | 983 | } |
@@ -991,7 +991,7 @@ discard block |
||
| 991 | 991 | |
| 992 | 992 | imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $w, $h, $w, $h); |
| 993 | 993 | if ($process == false) { |
| 994 | - $this->logger->error(__METHOD__ . '(): Error re-sampling process image ' . $w . 'x' . $h, array('app' => 'core')); |
|
| 994 | + $this->logger->error(__METHOD__.'(): Error re-sampling process image '.$w.'x'.$h, array('app' => 'core')); |
|
| 995 | 995 | imagedestroy($process); |
| 996 | 996 | return false; |
| 997 | 997 | } |
@@ -1011,7 +1011,7 @@ discard block |
||
| 1011 | 1011 | */ |
| 1012 | 1012 | public function fitIn($maxWidth, $maxHeight) { |
| 1013 | 1013 | if (!$this->valid()) { |
| 1014 | - $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core')); |
|
| 1014 | + $this->logger->error(__METHOD__.'(): No image loaded', array('app' => 'core')); |
|
| 1015 | 1015 | return false; |
| 1016 | 1016 | } |
| 1017 | 1017 | $widthOrig = imagesx($this->resource); |
@@ -1021,7 +1021,7 @@ discard block |
||
| 1021 | 1021 | $newWidth = min($maxWidth, $ratio * $maxHeight); |
| 1022 | 1022 | $newHeight = min($maxHeight, $maxWidth / $ratio); |
| 1023 | 1023 | |
| 1024 | - $this->preciseResize((int)round($newWidth), (int)round($newHeight)); |
|
| 1024 | + $this->preciseResize((int) round($newWidth), (int) round($newHeight)); |
|
| 1025 | 1025 | return true; |
| 1026 | 1026 | } |
| 1027 | 1027 | |
@@ -1034,7 +1034,7 @@ discard block |
||
| 1034 | 1034 | */ |
| 1035 | 1035 | public function scaleDownToFit($maxWidth, $maxHeight) { |
| 1036 | 1036 | if (!$this->valid()) { |
| 1037 | - $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core')); |
|
| 1037 | + $this->logger->error(__METHOD__.'(): No image loaded', array('app' => 'core')); |
|
| 1038 | 1038 | return false; |
| 1039 | 1039 | } |
| 1040 | 1040 | $widthOrig = imagesx($this->resource); |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | if ($bit <= 8) { |
| 1093 | 1093 | for ($i = 0; $i < $colorsNum; $i++) { |
| 1094 | 1094 | $colors = imagecolorsforindex($im, $i); |
| 1095 | - $rgbQuad .= chr($colors['blue']) . chr($colors['green']) . chr($colors['red']) . "\0"; |
|
| 1095 | + $rgbQuad .= chr($colors['blue']).chr($colors['green']).chr($colors['red'])."\0"; |
|
| 1096 | 1096 | } |
| 1097 | 1097 | $bmpData = ''; |
| 1098 | 1098 | if ($compression == 0 || $bit < 8) { |
@@ -1125,7 +1125,7 @@ discard block |
||
| 1125 | 1125 | $index = imagecolorat($im, $i, $j); |
| 1126 | 1126 | if ($index !== $lastIndex || $sameNum > 255) { |
| 1127 | 1127 | if ($sameNum != 0) { |
| 1128 | - $bmpData .= chr($sameNum) . chr($lastIndex); |
|
| 1128 | + $bmpData .= chr($sameNum).chr($lastIndex); |
|
| 1129 | 1129 | } |
| 1130 | 1130 | $lastIndex = $index; |
| 1131 | 1131 | $sameNum = 1; |
@@ -1166,15 +1166,15 @@ discard block |
||
| 1166 | 1166 | $sizeData = strlen($bmpData); |
| 1167 | 1167 | $colorsNum = 0; |
| 1168 | 1168 | } |
| 1169 | - $fileHeader = 'BM' . pack('V3', 54 + $sizeQuad + $sizeData, 0, 54 + $sizeQuad); |
|
| 1169 | + $fileHeader = 'BM'.pack('V3', 54 + $sizeQuad + $sizeData, 0, 54 + $sizeQuad); |
|
| 1170 | 1170 | $infoHeader = pack('V3v2V*', 0x28, $width, $height, 1, $bit, $compression, $sizeData, 0, 0, $colorsNum, 0); |
| 1171 | 1171 | if ($fileName != '') { |
| 1172 | 1172 | $fp = fopen($fileName, 'wb'); |
| 1173 | - fwrite($fp, $fileHeader . $infoHeader . $rgbQuad . $bmpData); |
|
| 1173 | + fwrite($fp, $fileHeader.$infoHeader.$rgbQuad.$bmpData); |
|
| 1174 | 1174 | fclose($fp); |
| 1175 | 1175 | return true; |
| 1176 | 1176 | } |
| 1177 | - echo $fileHeader . $infoHeader . $rgbQuad . $bmpData; |
|
| 1177 | + echo $fileHeader.$infoHeader.$rgbQuad.$bmpData; |
|
| 1178 | 1178 | return true; |
| 1179 | 1179 | } |
| 1180 | 1180 | } |
@@ -163,21 +163,21 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | public static function cacheEntryFromData($data, IMimeTypeLoader $mimetypeLoader) { |
| 165 | 165 | //fix types |
| 166 | - $data['fileid'] = (int)$data['fileid']; |
|
| 167 | - $data['parent'] = (int)$data['parent']; |
|
| 166 | + $data['fileid'] = (int) $data['fileid']; |
|
| 167 | + $data['parent'] = (int) $data['parent']; |
|
| 168 | 168 | $data['size'] = 0 + $data['size']; |
| 169 | - $data['mtime'] = (int)$data['mtime']; |
|
| 170 | - $data['storage_mtime'] = (int)$data['storage_mtime']; |
|
| 171 | - $data['encryptedVersion'] = (int)$data['encrypted']; |
|
| 172 | - $data['encrypted'] = (bool)$data['encrypted']; |
|
| 169 | + $data['mtime'] = (int) $data['mtime']; |
|
| 170 | + $data['storage_mtime'] = (int) $data['storage_mtime']; |
|
| 171 | + $data['encryptedVersion'] = (int) $data['encrypted']; |
|
| 172 | + $data['encrypted'] = (bool) $data['encrypted']; |
|
| 173 | 173 | $data['storage_id'] = $data['storage']; |
| 174 | - $data['storage'] = (int)$data['storage']; |
|
| 174 | + $data['storage'] = (int) $data['storage']; |
|
| 175 | 175 | $data['mimetype'] = $mimetypeLoader->getMimetypeById($data['mimetype']); |
| 176 | 176 | $data['mimepart'] = $mimetypeLoader->getMimetypeById($data['mimepart']); |
| 177 | 177 | if ($data['storage_mtime'] == 0) { |
| 178 | 178 | $data['storage_mtime'] = $data['mtime']; |
| 179 | 179 | } |
| 180 | - $data['permissions'] = (int)$data['permissions']; |
|
| 180 | + $data['permissions'] = (int) $data['permissions']; |
|
| 181 | 181 | return new CacheEntry($data); |
| 182 | 182 | } |
| 183 | 183 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | FROM `*PREFIX*filecache` WHERE `parent` = ? ORDER BY `name` ASC'; |
| 206 | 206 | $result = $this->connection->executeQuery($sql, [$fileId]); |
| 207 | 207 | $files = $result->fetchAll(); |
| 208 | - return array_map(function (array $data) { |
|
| 208 | + return array_map(function(array $data) { |
|
| 209 | 209 | return self::cacheEntryFromData($data, $this->mimetypeLoader); |
| 210 | 210 | }, $files); |
| 211 | 211 | } |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | $queryParts[] = '`storage`'; |
| 265 | 265 | $params[] = $this->getNumericStorageId(); |
| 266 | 266 | |
| 267 | - $queryParts = array_map(function ($item) { |
|
| 267 | + $queryParts = array_map(function($item) { |
|
| 268 | 268 | return trim($item, "`"); |
| 269 | 269 | }, $queryParts); |
| 270 | 270 | $values = array_combine($queryParts, $params); |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | 'path_hash', |
| 274 | 274 | ]) |
| 275 | 275 | ) { |
| 276 | - return (int)$this->connection->lastInsertId('*PREFIX*filecache'); |
|
| 276 | + return (int) $this->connection->lastInsertId('*PREFIX*filecache'); |
|
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | // The file was created in the mean time |
@@ -311,10 +311,10 @@ discard block |
||
| 311 | 311 | |
| 312 | 312 | // don't update if the data we try to set is the same as the one in the record |
| 313 | 313 | // some databases (Postgres) don't like superfluous updates |
| 314 | - $sql = 'UPDATE `*PREFIX*filecache` SET ' . implode(' = ?, ', $queryParts) . '=? ' . |
|
| 315 | - 'WHERE (' . |
|
| 316 | - implode(' <> ? OR ', $queryParts) . ' <> ? OR ' . |
|
| 317 | - implode(' IS NULL OR ', $queryParts) . ' IS NULL' . |
|
| 314 | + $sql = 'UPDATE `*PREFIX*filecache` SET '.implode(' = ?, ', $queryParts).'=? '. |
|
| 315 | + 'WHERE ('. |
|
| 316 | + implode(' <> ? OR ', $queryParts).' <> ? OR '. |
|
| 317 | + implode(' IS NULL OR ', $queryParts).' IS NULL'. |
|
| 318 | 318 | ') AND `fileid` = ? '; |
| 319 | 319 | $this->connection->executeQuery($sql, $params); |
| 320 | 320 | |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | } |
| 366 | 366 | } |
| 367 | 367 | $params[] = $value; |
| 368 | - $queryParts[] = '`' . $name . '`'; |
|
| 368 | + $queryParts[] = '`'.$name.'`'; |
|
| 369 | 369 | } |
| 370 | 370 | } |
| 371 | 371 | return array($queryParts, $params); |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | return -1; |
| 408 | 408 | } else { |
| 409 | 409 | $parent = $this->getParentPath($file); |
| 410 | - return (int)$this->getId($parent); |
|
| 410 | + return (int) $this->getId($parent); |
|
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | */ |
| 454 | 454 | private function getSubFolders($entry) { |
| 455 | 455 | $children = $this->getFolderContentsById($entry['fileid']); |
| 456 | - return array_filter($children, function ($child) { |
|
| 456 | + return array_filter($children, function($child) { |
|
| 457 | 457 | return $child['mimetype'] === 'httpd/unix-directory'; |
| 458 | 458 | }); |
| 459 | 459 | } |
@@ -517,10 +517,10 @@ discard block |
||
| 517 | 517 | list($targetStorageId, $targetPath) = $this->getMoveInfo($targetPath); |
| 518 | 518 | |
| 519 | 519 | if (is_null($sourceStorageId) || $sourceStorageId === false) { |
| 520 | - throw new \Exception('Invalid source storage id: ' . $sourceStorageId); |
|
| 520 | + throw new \Exception('Invalid source storage id: '.$sourceStorageId); |
|
| 521 | 521 | } |
| 522 | 522 | if (is_null($targetStorageId) || $targetStorageId === false) { |
| 523 | - throw new \Exception('Invalid target storage id: ' . $targetStorageId); |
|
| 523 | + throw new \Exception('Invalid target storage id: '.$targetStorageId); |
|
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | $this->connection->beginTransaction(); |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | ->set('path_hash', $fun->md5($newPathFunction)) |
| 540 | 540 | ->set('path', $newPathFunction) |
| 541 | 541 | ->where($query->expr()->eq('storage', $query->createNamedParameter($sourceStorageId, IQueryBuilder::PARAM_INT))) |
| 542 | - ->andWhere($query->expr()->like('path', $query->createNamedParameter($this->connection->escapeLikeParameter($sourcePath) . '/%'))); |
|
| 542 | + ->andWhere($query->expr()->like('path', $query->createNamedParameter($this->connection->escapeLikeParameter($sourcePath).'/%'))); |
|
| 543 | 543 | |
| 544 | 544 | try { |
| 545 | 545 | $query->execute(); |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | $sql = 'SELECT `size` FROM `*PREFIX*filecache` WHERE `storage` = ? AND `path_hash` = ?'; |
| 589 | 589 | $result = $this->connection->executeQuery($sql, array($this->getNumericStorageId(), $pathHash)); |
| 590 | 590 | if ($row = $result->fetch()) { |
| 591 | - if ((int)$row['size'] === -1) { |
|
| 591 | + if ((int) $row['size'] === -1) { |
|
| 592 | 592 | return self::SHALLOW; |
| 593 | 593 | } else { |
| 594 | 594 | return self::COMPLETE; |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | private function searchResultToCacheEntries(Statement $result) { |
| 638 | 638 | $files = $result->fetchAll(); |
| 639 | 639 | |
| 640 | - return array_map(function (array $data) { |
|
| 640 | + return array_map(function(array $data) { |
|
| 641 | 641 | return self::cacheEntryFromData($data, $this->mimetypeLoader); |
| 642 | 642 | }, $files); |
| 643 | 643 | } |
@@ -656,7 +656,7 @@ discard block |
||
| 656 | 656 | $where = '`mimepart` = ?'; |
| 657 | 657 | } |
| 658 | 658 | $sql = 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `storage_mtime`, `mtime`, `encrypted`, `etag`, `permissions`, `checksum` |
| 659 | - FROM `*PREFIX*filecache` WHERE ' . $where . ' AND `storage` = ?'; |
|
| 659 | + FROM `*PREFIX*filecache` WHERE ' . $where.' AND `storage` = ?'; |
|
| 660 | 660 | $mimetype = $this->mimetypeLoader->getId($mimetype); |
| 661 | 661 | $result = $this->connection->executeQuery($sql, array($mimetype, $this->getNumericStorageId())); |
| 662 | 662 | |
@@ -707,20 +707,20 @@ discard block |
||
| 707 | 707 | * @return ICacheEntry[] file data |
| 708 | 708 | */ |
| 709 | 709 | public function searchByTag($tag, $userId) { |
| 710 | - $sql = 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, ' . |
|
| 711 | - '`mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, ' . |
|
| 712 | - '`encrypted`, `etag`, `permissions`, `checksum` ' . |
|
| 713 | - 'FROM `*PREFIX*filecache` `file`, ' . |
|
| 714 | - '`*PREFIX*vcategory_to_object` `tagmap`, ' . |
|
| 715 | - '`*PREFIX*vcategory` `tag` ' . |
|
| 710 | + $sql = 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, '. |
|
| 711 | + '`mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, '. |
|
| 712 | + '`encrypted`, `etag`, `permissions`, `checksum` '. |
|
| 713 | + 'FROM `*PREFIX*filecache` `file`, '. |
|
| 714 | + '`*PREFIX*vcategory_to_object` `tagmap`, '. |
|
| 715 | + '`*PREFIX*vcategory` `tag` '. |
|
| 716 | 716 | // JOIN filecache to vcategory_to_object |
| 717 | - 'WHERE `file`.`fileid` = `tagmap`.`objid` ' . |
|
| 717 | + 'WHERE `file`.`fileid` = `tagmap`.`objid` '. |
|
| 718 | 718 | // JOIN vcategory_to_object to vcategory |
| 719 | - 'AND `tagmap`.`type` = `tag`.`type` ' . |
|
| 720 | - 'AND `tagmap`.`categoryid` = `tag`.`id` ' . |
|
| 719 | + 'AND `tagmap`.`type` = `tag`.`type` '. |
|
| 720 | + 'AND `tagmap`.`categoryid` = `tag`.`id` '. |
|
| 721 | 721 | // conditions |
| 722 | - 'AND `file`.`storage` = ? ' . |
|
| 723 | - 'AND `tag`.`type` = \'files\' ' . |
|
| 722 | + 'AND `file`.`storage` = ? '. |
|
| 723 | + 'AND `tag`.`type` = \'files\' '. |
|
| 724 | 724 | 'AND `tag`.`uid` = ? '; |
| 725 | 725 | if (is_int($tag)) { |
| 726 | 726 | $sql .= 'AND `tag`.`id` = ? '; |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | |
| 739 | 739 | $files = $result->fetchAll(); |
| 740 | 740 | |
| 741 | - return array_map(function (array $data) { |
|
| 741 | + return array_map(function(array $data) { |
|
| 742 | 742 | return self::cacheEntryFromData($data, $this->mimetypeLoader); |
| 743 | 743 | }, $files); |
| 744 | 744 | } |
@@ -774,8 +774,8 @@ discard block |
||
| 774 | 774 | } |
| 775 | 775 | if (isset($entry['mimetype']) && $entry['mimetype'] === 'httpd/unix-directory') { |
| 776 | 776 | $id = $entry['fileid']; |
| 777 | - $sql = 'SELECT SUM(`size`) AS f1, MIN(`size`) AS f2 ' . |
|
| 778 | - 'FROM `*PREFIX*filecache` ' . |
|
| 777 | + $sql = 'SELECT SUM(`size`) AS f1, MIN(`size`) AS f2 '. |
|
| 778 | + 'FROM `*PREFIX*filecache` '. |
|
| 779 | 779 | 'WHERE `parent` = ? AND `storage` = ?'; |
| 780 | 780 | $result = $this->connection->executeQuery($sql, array($id, $this->getNumericStorageId())); |
| 781 | 781 | if ($row = $result->fetch()) { |
@@ -69,15 +69,15 @@ discard block |
||
| 69 | 69 | $this->storageId = self::adjustStorageId($this->storageId); |
| 70 | 70 | |
| 71 | 71 | if ($row = self::getStorageById($this->storageId)) { |
| 72 | - $this->numericId = (int)$row['numeric_id']; |
|
| 72 | + $this->numericId = (int) $row['numeric_id']; |
|
| 73 | 73 | } else { |
| 74 | 74 | $connection = \OC::$server->getDatabaseConnection(); |
| 75 | 75 | $available = $isAvailable ? 1 : 0; |
| 76 | 76 | if ($connection->insertIfNotExist('*PREFIX*storages', ['id' => $this->storageId, 'available' => $available])) { |
| 77 | - $this->numericId = (int)$connection->lastInsertId('*PREFIX*storages'); |
|
| 77 | + $this->numericId = (int) $connection->lastInsertId('*PREFIX*storages'); |
|
| 78 | 78 | } else { |
| 79 | 79 | if ($row = self::getStorageById($this->storageId)) { |
| 80 | - $this->numericId = (int)$row['numeric_id']; |
|
| 80 | + $this->numericId = (int) $row['numeric_id']; |
|
| 81 | 81 | } else { |
| 82 | 82 | throw new \RuntimeException('Storage could neither be inserted nor be selected from the database'); |
| 83 | 83 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $storageId = self::adjustStorageId($storageId); |
| 143 | 143 | |
| 144 | 144 | if ($row = self::getStorageById($storageId)) { |
| 145 | - return (int)$row['numeric_id']; |
|
| 145 | + return (int) $row['numeric_id']; |
|
| 146 | 146 | } else { |
| 147 | 147 | return null; |
| 148 | 148 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | public function getAvailability() { |
| 155 | 155 | if ($row = self::getStorageById($this->storageId)) { |
| 156 | 156 | return [ |
| 157 | - 'available' => (int)$row['available'] === 1, |
|
| 157 | + 'available' => (int) $row['available'] === 1, |
|
| 158 | 158 | 'last_checked' => $row['last_checked'] |
| 159 | 159 | ]; |
| 160 | 160 | } else { |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $apps = $this->appManager->getEnabledAppsForUser($this->currentUser); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - foreach($apps as $app) { |
|
| 119 | + foreach ($apps as $app) { |
|
| 120 | 120 | $apps_paths[$app] = \OC_App::getAppWebPath($app); |
| 121 | 121 | } |
| 122 | 122 | |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | $outgoingServer2serverShareEnabled = $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes'; |
| 133 | 133 | |
| 134 | 134 | $countOfDataLocation = 0; |
| 135 | - $dataLocation = str_replace(\OC::$SERVERROOT .'/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation); |
|
| 136 | - if($countOfDataLocation !== 1 || !$this->groupManager->isAdmin($uid)) { |
|
| 135 | + $dataLocation = str_replace(\OC::$SERVERROOT.'/', '', $this->config->getSystemValue('datadirectory', ''), $countOfDataLocation); |
|
| 136 | + if ($countOfDataLocation !== 1 || !$this->groupManager->isAdmin($uid)) { |
|
| 137 | 137 | $dataLocation = false; |
| 138 | 138 | } |
| 139 | 139 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $array = [ |
| 150 | 150 | "oc_debug" => $this->config->getSystemValue('debug', false) ? 'true' : 'false', |
| 151 | 151 | "oc_isadmin" => $this->groupManager->isAdmin($uid) ? 'true' : 'false', |
| 152 | - "backendAllowsPasswordConfirmation" => $userBackend === 'user_saml'? 'false' : 'true', |
|
| 152 | + "backendAllowsPasswordConfirmation" => $userBackend === 'user_saml' ? 'false' : 'true', |
|
| 153 | 153 | "oc_dataURL" => is_string($dataLocation) ? "\"".$dataLocation."\"" : 'false', |
| 154 | 154 | "oc_webroot" => "\"".\OC::$WEBROOT."\"", |
| 155 | 155 | "oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution |
@@ -157,61 +157,61 @@ discard block |
||
| 157 | 157 | 'nc_lastLogin' => $lastConfirmTimestamp, |
| 158 | 158 | 'nc_pageLoad' => time(), |
| 159 | 159 | "dayNames" => json_encode([ |
| 160 | - (string)$this->l->t('Sunday'), |
|
| 161 | - (string)$this->l->t('Monday'), |
|
| 162 | - (string)$this->l->t('Tuesday'), |
|
| 163 | - (string)$this->l->t('Wednesday'), |
|
| 164 | - (string)$this->l->t('Thursday'), |
|
| 165 | - (string)$this->l->t('Friday'), |
|
| 166 | - (string)$this->l->t('Saturday') |
|
| 160 | + (string) $this->l->t('Sunday'), |
|
| 161 | + (string) $this->l->t('Monday'), |
|
| 162 | + (string) $this->l->t('Tuesday'), |
|
| 163 | + (string) $this->l->t('Wednesday'), |
|
| 164 | + (string) $this->l->t('Thursday'), |
|
| 165 | + (string) $this->l->t('Friday'), |
|
| 166 | + (string) $this->l->t('Saturday') |
|
| 167 | 167 | ]), |
| 168 | 168 | "dayNamesShort" => json_encode([ |
| 169 | - (string)$this->l->t('Sun.'), |
|
| 170 | - (string)$this->l->t('Mon.'), |
|
| 171 | - (string)$this->l->t('Tue.'), |
|
| 172 | - (string)$this->l->t('Wed.'), |
|
| 173 | - (string)$this->l->t('Thu.'), |
|
| 174 | - (string)$this->l->t('Fri.'), |
|
| 175 | - (string)$this->l->t('Sat.') |
|
| 169 | + (string) $this->l->t('Sun.'), |
|
| 170 | + (string) $this->l->t('Mon.'), |
|
| 171 | + (string) $this->l->t('Tue.'), |
|
| 172 | + (string) $this->l->t('Wed.'), |
|
| 173 | + (string) $this->l->t('Thu.'), |
|
| 174 | + (string) $this->l->t('Fri.'), |
|
| 175 | + (string) $this->l->t('Sat.') |
|
| 176 | 176 | ]), |
| 177 | 177 | "dayNamesMin" => json_encode([ |
| 178 | - (string)$this->l->t('Su'), |
|
| 179 | - (string)$this->l->t('Mo'), |
|
| 180 | - (string)$this->l->t('Tu'), |
|
| 181 | - (string)$this->l->t('We'), |
|
| 182 | - (string)$this->l->t('Th'), |
|
| 183 | - (string)$this->l->t('Fr'), |
|
| 184 | - (string)$this->l->t('Sa') |
|
| 178 | + (string) $this->l->t('Su'), |
|
| 179 | + (string) $this->l->t('Mo'), |
|
| 180 | + (string) $this->l->t('Tu'), |
|
| 181 | + (string) $this->l->t('We'), |
|
| 182 | + (string) $this->l->t('Th'), |
|
| 183 | + (string) $this->l->t('Fr'), |
|
| 184 | + (string) $this->l->t('Sa') |
|
| 185 | 185 | ]), |
| 186 | 186 | "monthNames" => json_encode([ |
| 187 | - (string)$this->l->t('January'), |
|
| 188 | - (string)$this->l->t('February'), |
|
| 189 | - (string)$this->l->t('March'), |
|
| 190 | - (string)$this->l->t('April'), |
|
| 191 | - (string)$this->l->t('May'), |
|
| 192 | - (string)$this->l->t('June'), |
|
| 193 | - (string)$this->l->t('July'), |
|
| 194 | - (string)$this->l->t('August'), |
|
| 195 | - (string)$this->l->t('September'), |
|
| 196 | - (string)$this->l->t('October'), |
|
| 197 | - (string)$this->l->t('November'), |
|
| 198 | - (string)$this->l->t('December') |
|
| 187 | + (string) $this->l->t('January'), |
|
| 188 | + (string) $this->l->t('February'), |
|
| 189 | + (string) $this->l->t('March'), |
|
| 190 | + (string) $this->l->t('April'), |
|
| 191 | + (string) $this->l->t('May'), |
|
| 192 | + (string) $this->l->t('June'), |
|
| 193 | + (string) $this->l->t('July'), |
|
| 194 | + (string) $this->l->t('August'), |
|
| 195 | + (string) $this->l->t('September'), |
|
| 196 | + (string) $this->l->t('October'), |
|
| 197 | + (string) $this->l->t('November'), |
|
| 198 | + (string) $this->l->t('December') |
|
| 199 | 199 | ]), |
| 200 | 200 | "monthNamesShort" => json_encode([ |
| 201 | - (string)$this->l->t('Jan.'), |
|
| 202 | - (string)$this->l->t('Feb.'), |
|
| 203 | - (string)$this->l->t('Mar.'), |
|
| 204 | - (string)$this->l->t('Apr.'), |
|
| 205 | - (string)$this->l->t('May.'), |
|
| 206 | - (string)$this->l->t('Jun.'), |
|
| 207 | - (string)$this->l->t('Jul.'), |
|
| 208 | - (string)$this->l->t('Aug.'), |
|
| 209 | - (string)$this->l->t('Sep.'), |
|
| 210 | - (string)$this->l->t('Oct.'), |
|
| 211 | - (string)$this->l->t('Nov.'), |
|
| 212 | - (string)$this->l->t('Dec.') |
|
| 201 | + (string) $this->l->t('Jan.'), |
|
| 202 | + (string) $this->l->t('Feb.'), |
|
| 203 | + (string) $this->l->t('Mar.'), |
|
| 204 | + (string) $this->l->t('Apr.'), |
|
| 205 | + (string) $this->l->t('May.'), |
|
| 206 | + (string) $this->l->t('Jun.'), |
|
| 207 | + (string) $this->l->t('Jul.'), |
|
| 208 | + (string) $this->l->t('Aug.'), |
|
| 209 | + (string) $this->l->t('Sep.'), |
|
| 210 | + (string) $this->l->t('Oct.'), |
|
| 211 | + (string) $this->l->t('Nov.'), |
|
| 212 | + (string) $this->l->t('Dec.') |
|
| 213 | 213 | ]), |
| 214 | - "firstDay" => json_encode($this->l->l('firstday', null)) , |
|
| 214 | + "firstDay" => json_encode($this->l->l('firstday', null)), |
|
| 215 | 215 | "oc_config" => json_encode([ |
| 216 | 216 | 'session_lifetime' => min($this->config->getSystemValue('session_lifetime', $this->iniWrapper->getNumeric('session.gc_maxlifetime')), $this->iniWrapper->getNumeric('session.gc_maxlifetime')), |
| 217 | 217 | 'session_keepalive' => $this->config->getSystemValue('session_keepalive', true), |
@@ -220,8 +220,8 @@ discard block |
||
| 220 | 220 | 'enable_avatars' => true, // here for legacy reasons - to not crash existing code that relies on this value |
| 221 | 221 | 'lost_password_link'=> $this->config->getSystemValue('lost_password_link', null), |
| 222 | 222 | 'modRewriteWorking' => $this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true', |
| 223 | - 'sharing.maxAutocompleteResults' => (int)$this->config->getSystemValue('sharing.maxAutocompleteResults', 0), |
|
| 224 | - 'sharing.minSearchStringLength' => (int)$this->config->getSystemValue('sharing.minSearchStringLength', 0), |
|
| 223 | + 'sharing.maxAutocompleteResults' => (int) $this->config->getSystemValue('sharing.maxAutocompleteResults', 0), |
|
| 224 | + 'sharing.minSearchStringLength' => (int) $this->config->getSystemValue('sharing.minSearchStringLength', 0), |
|
| 225 | 225 | 'blacklist_files_regex' => \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX, |
| 226 | 226 | ]), |
| 227 | 227 | "oc_appconfig" => json_encode([ |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | if ($this->currentUser !== null) { |
| 258 | 258 | $array['oc_userconfig'] = json_encode([ |
| 259 | 259 | 'avatar' => [ |
| 260 | - 'version' => (int)$this->config->getUserValue($uid, 'avatar', 'version', 0), |
|
| 260 | + 'version' => (int) $this->config->getUserValue($uid, 'avatar', 'version', 0), |
|
| 261 | 261 | 'generated' => $this->config->getUserValue($uid, 'avatar', 'generated', 'true') === 'true', |
| 262 | 262 | ] |
| 263 | 263 | ]); |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | |
| 271 | 271 | // Echo it |
| 272 | 272 | foreach ($array as $setting => $value) { |
| 273 | - $result .= 'var '. $setting . '='. $value . ';' . PHP_EOL; |
|
| 273 | + $result .= 'var '.$setting.'='.$value.';'.PHP_EOL; |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | return $result; |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | $params = array(); |
| 94 | 94 | if (count($ids) == 1 && isset($uidOwner)) { |
| 95 | 95 | // FIXME: don't concat $parents, use Docrine's PARAM_INT_ARRAY approach |
| 96 | - $queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, ' . |
|
| 97 | - '`item_target`, `file_target`, `parent` ' . |
|
| 98 | - 'FROM `*PREFIX*share` ' . |
|
| 96 | + $queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, '. |
|
| 97 | + '`item_target`, `file_target`, `parent` '. |
|
| 98 | + 'FROM `*PREFIX*share` '. |
|
| 99 | 99 | 'WHERE `parent` IN ('.$parents.') AND `uid_owner` = ? '; |
| 100 | 100 | $params[] = $uidOwner; |
| 101 | 101 | } else { |
| 102 | - $queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, ' . |
|
| 103 | - '`item_target`, `file_target`, `parent`, `uid_owner` ' . |
|
| 102 | + $queryString = 'SELECT `id`, `share_with`, `item_type`, `share_type`, '. |
|
| 103 | + '`item_target`, `file_target`, `parent`, `uid_owner` '. |
|
| 104 | 104 | 'FROM `*PREFIX*share` WHERE `parent` IN ('.$parents.') '; |
| 105 | 105 | } |
| 106 | 106 | if ($excludeGroupChildren) { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | 'shareWith' => $item['share_with'], |
| 118 | 118 | 'itemTarget' => $item['item_target'], |
| 119 | 119 | 'itemType' => $item['item_type'], |
| 120 | - 'shareType' => (int)$item['share_type'], |
|
| 120 | + 'shareType' => (int) $item['share_type'], |
|
| 121 | 121 | ); |
| 122 | 122 | if (isset($item['file_target'])) { |
| 123 | 123 | $tmpItem['fileTarget'] = $item['file_target']; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | if ($defaultExpireDate === 'yes') { |
| 169 | 169 | $enforceExpireDate = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no'); |
| 170 | 170 | $defaultExpireSettings['defaultExpireDateSet'] = true; |
| 171 | - $defaultExpireSettings['expireAfterDays'] = (int)$config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
| 171 | + $defaultExpireSettings['expireAfterDays'] = (int) $config->getAppValue('core', 'shareapi_expire_after_n_days', '7'); |
|
| 172 | 172 | $defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes'; |
| 173 | 173 | } |
| 174 | 174 | |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | $this->printErrors($output, $errors); |
| 90 | 90 | |
| 91 | 91 | // ignore the OS X setup warning |
| 92 | - if(count($errors) !== 1 || |
|
| 93 | - (string)$errors[0]['error'] !== 'Mac OS X is not supported and Nextcloud will not work properly on this platform. Use it at your own risk! ') { |
|
| 92 | + if (count($errors) !== 1 || |
|
| 93 | + (string) $errors[0]['error'] !== 'Mac OS X is not supported and Nextcloud will not work properly on this platform. Use it at your own risk! ') { |
|
| 94 | 94 | return 1; |
| 95 | 95 | } |
| 96 | 96 | } |
@@ -194,10 +194,10 @@ discard block |
||
| 194 | 194 | protected function printErrors(OutputInterface $output, $errors) { |
| 195 | 195 | foreach ($errors as $error) { |
| 196 | 196 | if (is_array($error)) { |
| 197 | - $output->writeln('<error>' . (string)$error['error'] . '</error>'); |
|
| 198 | - $output->writeln('<info> -> ' . (string)$error['hint'] . '</info>'); |
|
| 197 | + $output->writeln('<error>'.(string) $error['error'].'</error>'); |
|
| 198 | + $output->writeln('<info> -> '.(string) $error['hint'].'</info>'); |
|
| 199 | 199 | } else { |
| 200 | - $output->writeln('<error>' . (string)$error . '</error>'); |
|
| 200 | + $output->writeln('<error>'.(string) $error.'</error>'); |
|
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | } |
@@ -18,18 +18,18 @@ |
||
| 18 | 18 | <?php emit_script_loading_tags($_); ?> |
| 19 | 19 | <?php print_unescaped($_['headers']); ?> |
| 20 | 20 | </head> |
| 21 | - <body id="<?php p($_['bodyid']);?>"> |
|
| 21 | + <body id="<?php p($_['bodyid']); ?>"> |
|
| 22 | 22 | <?php include 'layout.noscript.warning.php'; ?> |
| 23 | 23 | <div class="wrapper"> |
| 24 | 24 | <div class="v-align"> |
| 25 | - <?php if ($_['bodyid'] === 'body-login' ): ?> |
|
| 25 | + <?php if ($_['bodyid'] === 'body-login'): ?> |
|
| 26 | 26 | <header role="banner"> |
| 27 | 27 | <div id="header"> |
| 28 | 28 | <div class="logo"> |
| 29 | 29 | <h1 class="hidden-visually"> |
| 30 | 30 | <?php p($theme->getName()); ?> |
| 31 | 31 | </h1> |
| 32 | - <?php if(\OC::$server->getConfig()->getSystemValue('installed', false) |
|
| 32 | + <?php if (\OC::$server->getConfig()->getSystemValue('installed', false) |
|
| 33 | 33 | && \OC::$server->getConfig()->getAppValue('theming', 'logoMime', false)): ?> |
| 34 | 34 | <img src="<?php p($theme->getLogo()); ?>"/> |
| 35 | 35 | <?php endif; ?> |