@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | private static function initLocalStorageRootFS() { |
| 82 | 82 | // mount local file backend as root |
| 83 | - $configDataDirectory = \OC::$server->getSystemConfig()->getValue("datadirectory", OC::$SERVERROOT . "/data"); |
|
| 83 | + $configDataDirectory = \OC::$server->getSystemConfig()->getValue("datadirectory", OC::$SERVERROOT."/data"); |
|
| 84 | 84 | //first set up the local "root" storage |
| 85 | 85 | \OC\Files\Filesystem::initMountManager(); |
| 86 | 86 | if (!self::$rootMounted) { |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | \OC\Files\Filesystem::initMountManager(); |
| 203 | 203 | |
| 204 | 204 | \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false); |
| 205 | - \OC\Files\Filesystem::addStorageWrapper('mount_options', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
| 205 | + \OC\Files\Filesystem::addStorageWrapper('mount_options', function($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
| 206 | 206 | if ($storage->instanceOfStorage('\OC\Files\Storage\Common')) { |
| 207 | 207 | /** @var \OC\Files\Storage\Common $storage */ |
| 208 | 208 | $storage->setMountOptions($mount->getOptions()); |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | return $storage; |
| 211 | 211 | }); |
| 212 | 212 | |
| 213 | - \OC\Files\Filesystem::addStorageWrapper('enable_sharing', function ($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
| 213 | + \OC\Files\Filesystem::addStorageWrapper('enable_sharing', function($mountPoint, \OCP\Files\Storage\IStorage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
| 214 | 214 | if (!$mount->getOption('enable_sharing', true)) { |
| 215 | 215 | return new \OC\Files\Storage\Wrapper\PermissionsMask([ |
| 216 | 216 | 'storage' => $storage, |
@@ -221,21 +221,21 @@ discard block |
||
| 221 | 221 | }); |
| 222 | 222 | |
| 223 | 223 | // install storage availability wrapper, before most other wrappers |
| 224 | - \OC\Files\Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, \OCP\Files\Storage\IStorage $storage) { |
|
| 224 | + \OC\Files\Filesystem::addStorageWrapper('oc_availability', function($mountPoint, \OCP\Files\Storage\IStorage $storage) { |
|
| 225 | 225 | if (!$storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage') && !$storage->isLocal()) { |
| 226 | 226 | return new \OC\Files\Storage\Wrapper\Availability(['storage' => $storage]); |
| 227 | 227 | } |
| 228 | 228 | return $storage; |
| 229 | 229 | }); |
| 230 | 230 | |
| 231 | - \OC\Files\Filesystem::addStorageWrapper('oc_encoding', function ($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
| 231 | + \OC\Files\Filesystem::addStorageWrapper('oc_encoding', function($mountPoint, \OCP\Files\Storage $storage, \OCP\Files\Mount\IMountPoint $mount) { |
|
| 232 | 232 | if ($mount->getOption('encoding_compatibility', false) && !$storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage') && !$storage->isLocal()) { |
| 233 | 233 | return new \OC\Files\Storage\Wrapper\Encoding(['storage' => $storage]); |
| 234 | 234 | } |
| 235 | 235 | return $storage; |
| 236 | 236 | }); |
| 237 | 237 | |
| 238 | - \OC\Files\Filesystem::addStorageWrapper('oc_quota', function ($mountPoint, $storage) { |
|
| 238 | + \OC\Files\Filesystem::addStorageWrapper('oc_quota', function($mountPoint, $storage) { |
|
| 239 | 239 | // set up quota for home storages, even for other users |
| 240 | 240 | // which can happen when using sharing |
| 241 | 241 | |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | //if we aren't logged in, there is no use to set up the filesystem |
| 283 | 283 | if ($user != "") { |
| 284 | 284 | |
| 285 | - $userDir = '/' . $user . '/files'; |
|
| 285 | + $userDir = '/'.$user.'/files'; |
|
| 286 | 286 | |
| 287 | 287 | //jail the user into his "home" directory |
| 288 | 288 | \OC\Files\Filesystem::init($user, $userDir); |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | return \OCP\Files\FileInfo::SPACE_UNLIMITED; |
| 364 | 364 | } |
| 365 | 365 | $userQuota = $user->getQuota(); |
| 366 | - if($userQuota === 'none') { |
|
| 366 | + if ($userQuota === 'none') { |
|
| 367 | 367 | return \OCP\Files\FileInfo::SPACE_UNLIMITED; |
| 368 | 368 | } |
| 369 | 369 | return OC_Helper::computerFileSize($userQuota); |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | */ |
| 380 | 380 | public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) { |
| 381 | 381 | |
| 382 | - $plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton'); |
|
| 382 | + $plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT.'/core/skeleton'); |
|
| 383 | 383 | $userLang = \OC::$server->getL10NFactory()->findLanguage(); |
| 384 | 384 | $skeletonDirectory = str_replace('{lang}', $userLang, $plainSkeletonDirectory); |
| 385 | 385 | |
@@ -401,9 +401,9 @@ discard block |
||
| 401 | 401 | if ($instanceId === null) { |
| 402 | 402 | throw new \RuntimeException('no instance id!'); |
| 403 | 403 | } |
| 404 | - $appdata = 'appdata_' . $instanceId; |
|
| 404 | + $appdata = 'appdata_'.$instanceId; |
|
| 405 | 405 | if ($userId === $appdata) { |
| 406 | - throw new \RuntimeException('username is reserved name: ' . $appdata); |
|
| 406 | + throw new \RuntimeException('username is reserved name: '.$appdata); |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | if (!empty($skeletonDirectory)) { |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | |
| 431 | 431 | // Verify if folder exists |
| 432 | 432 | $dir = opendir($source); |
| 433 | - if($dir === false) { |
|
| 433 | + if ($dir === false) { |
|
| 434 | 434 | $logger->error(sprintf('Could not opendir "%s"', $source), ['app' => 'core']); |
| 435 | 435 | return; |
| 436 | 436 | } |
@@ -438,14 +438,14 @@ discard block |
||
| 438 | 438 | // Copy the files |
| 439 | 439 | while (false !== ($file = readdir($dir))) { |
| 440 | 440 | if (!\OC\Files\Filesystem::isIgnoredDir($file)) { |
| 441 | - if (is_dir($source . '/' . $file)) { |
|
| 441 | + if (is_dir($source.'/'.$file)) { |
|
| 442 | 442 | $child = $target->newFolder($file); |
| 443 | - self::copyr($source . '/' . $file, $child); |
|
| 443 | + self::copyr($source.'/'.$file, $child); |
|
| 444 | 444 | } else { |
| 445 | 445 | $child = $target->newFile($file); |
| 446 | - $sourceStream = fopen($source . '/' . $file, 'r'); |
|
| 447 | - if($sourceStream === false) { |
|
| 448 | - $logger->error(sprintf('Could not fopen "%s"', $source . '/' . $file), ['app' => 'core']); |
|
| 446 | + $sourceStream = fopen($source.'/'.$file, 'r'); |
|
| 447 | + if ($sourceStream === false) { |
|
| 448 | + $logger->error(sprintf('Could not fopen "%s"', $source.'/'.$file), ['app' => 'core']); |
|
| 449 | 449 | closedir($dir); |
| 450 | 450 | return; |
| 451 | 451 | } |
@@ -522,8 +522,8 @@ discard block |
||
| 522 | 522 | return; |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | - $timestamp = filemtime(OC::$SERVERROOT . '/version.php'); |
|
| 526 | - require OC::$SERVERROOT . '/version.php'; |
|
| 525 | + $timestamp = filemtime(OC::$SERVERROOT.'/version.php'); |
|
| 526 | + require OC::$SERVERROOT.'/version.php'; |
|
| 527 | 527 | /** @var $timestamp int */ |
| 528 | 528 | self::$versionCache['OC_Version_Timestamp'] = $timestamp; |
| 529 | 529 | /** @var $OC_Version string */ |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | |
| 571 | 571 | // core js files need separate handling |
| 572 | 572 | if ($application !== 'core' && $file !== null) { |
| 573 | - self::addTranslations ( $application ); |
|
| 573 | + self::addTranslations($application); |
|
| 574 | 574 | } |
| 575 | 575 | self::addExternalResource($application, $prepend, $path, "script"); |
| 576 | 576 | } |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | if ($type === "style") { |
| 648 | 648 | if (!in_array($path, self::$styles)) { |
| 649 | 649 | if ($prepend === true) { |
| 650 | - array_unshift ( self::$styles, $path ); |
|
| 650 | + array_unshift(self::$styles, $path); |
|
| 651 | 651 | } else { |
| 652 | 652 | self::$styles[] = $path; |
| 653 | 653 | } |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | } elseif ($type === "script") { |
| 656 | 656 | if (!in_array($path, self::$scripts)) { |
| 657 | 657 | if ($prepend === true) { |
| 658 | - array_unshift ( self::$scripts, $path ); |
|
| 658 | + array_unshift(self::$scripts, $path); |
|
| 659 | 659 | } else { |
| 660 | 660 | self::$scripts [] = $path; |
| 661 | 661 | } |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | * @param array $attributes array of attributes for the element |
| 672 | 672 | * @param string $text the text content for the element |
| 673 | 673 | */ |
| 674 | - public static function addHeader($tag, $attributes, $text=null) { |
|
| 674 | + public static function addHeader($tag, $attributes, $text = null) { |
|
| 675 | 675 | self::$headers[] = array( |
| 676 | 676 | 'tag' => $tag, |
| 677 | 677 | 'attributes' => $attributes, |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | public static function checkServer(\OC\SystemConfig $config) { |
| 712 | 712 | $l = \OC::$server->getL10N('lib'); |
| 713 | 713 | $errors = array(); |
| 714 | - $CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT . '/data'); |
|
| 714 | + $CONFIG_DATADIRECTORY = $config->getValue('datadirectory', OC::$SERVERROOT.'/data'); |
|
| 715 | 715 | |
| 716 | 716 | if (!self::needUpgrade($config) && $config->getValue('installed', false)) { |
| 717 | 717 | // this check needs to be done every time |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | } |
| 747 | 747 | |
| 748 | 748 | // Check if config folder is writable. |
| 749 | - if(!OC_Helper::isReadOnlyConfigEnabled()) { |
|
| 749 | + if (!OC_Helper::isReadOnlyConfigEnabled()) { |
|
| 750 | 750 | if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) { |
| 751 | 751 | $errors[] = array( |
| 752 | 752 | 'error' => $l->t('Cannot write into "config" directory'), |
@@ -886,15 +886,15 @@ discard block |
||
| 886 | 886 | } |
| 887 | 887 | } |
| 888 | 888 | |
| 889 | - foreach($missingDependencies as $missingDependency) { |
|
| 889 | + foreach ($missingDependencies as $missingDependency) { |
|
| 890 | 890 | $errors[] = array( |
| 891 | 891 | 'error' => $l->t('PHP module %s not installed.', array($missingDependency)), |
| 892 | 892 | 'hint' => $moduleHint |
| 893 | 893 | ); |
| 894 | 894 | $webServerRestart = true; |
| 895 | 895 | } |
| 896 | - foreach($invalidIniSettings as $setting) { |
|
| 897 | - if(is_bool($setting[1])) { |
|
| 896 | + foreach ($invalidIniSettings as $setting) { |
|
| 897 | + if (is_bool($setting[1])) { |
|
| 898 | 898 | $setting[1] = ($setting[1]) ? 'on' : 'off'; |
| 899 | 899 | } |
| 900 | 900 | $errors[] = [ |
@@ -912,7 +912,7 @@ discard block |
||
| 912 | 912 | * TODO: Should probably be implemented in the above generic dependency |
| 913 | 913 | * check somehow in the long-term. |
| 914 | 914 | */ |
| 915 | - if($iniWrapper->getBool('mbstring.func_overload') !== null && |
|
| 915 | + if ($iniWrapper->getBool('mbstring.func_overload') !== null && |
|
| 916 | 916 | $iniWrapper->getBool('mbstring.func_overload') === true) { |
| 917 | 917 | $errors[] = array( |
| 918 | 918 | 'error' => $l->t('mbstring.func_overload is set to "%s" instead of the expected value "0"', [$iniWrapper->getString('mbstring.func_overload')]), |
@@ -920,16 +920,16 @@ discard block |
||
| 920 | 920 | ); |
| 921 | 921 | } |
| 922 | 922 | |
| 923 | - if(function_exists('xml_parser_create') && |
|
| 924 | - LIBXML_LOADED_VERSION < 20700 ) { |
|
| 923 | + if (function_exists('xml_parser_create') && |
|
| 924 | + LIBXML_LOADED_VERSION < 20700) { |
|
| 925 | 925 | $version = LIBXML_LOADED_VERSION; |
| 926 | - $major = floor($version/10000); |
|
| 926 | + $major = floor($version / 10000); |
|
| 927 | 927 | $version -= ($major * 10000); |
| 928 | - $minor = floor($version/100); |
|
| 928 | + $minor = floor($version / 100); |
|
| 929 | 929 | $version -= ($minor * 100); |
| 930 | 930 | $patch = $version; |
| 931 | 931 | $errors[] = array( |
| 932 | - 'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [$major . '.' . $minor . '.' . $patch]), |
|
| 932 | + 'error' => $l->t('libxml2 2.7.0 is at least required. Currently %s is installed.', [$major.'.'.$minor.'.'.$patch]), |
|
| 933 | 933 | 'hint' => $l->t('To fix this issue update your libxml2 version and restart your web server.') |
| 934 | 934 | ); |
| 935 | 935 | } |
@@ -995,7 +995,7 @@ discard block |
||
| 995 | 995 | * @return array arrays with error messages and hints |
| 996 | 996 | */ |
| 997 | 997 | public static function checkDataDirectoryPermissions($dataDirectory) { |
| 998 | - if(\OC::$server->getConfig()->getSystemValue('check_data_directory_permissions', true) === false) { |
|
| 998 | + if (\OC::$server->getConfig()->getSystemValue('check_data_directory_permissions', true) === false) { |
|
| 999 | 999 | return []; |
| 1000 | 1000 | } |
| 1001 | 1001 | $l = \OC::$server->getL10N('lib'); |
@@ -1033,10 +1033,10 @@ discard block |
||
| 1033 | 1033 | 'hint' => $l->t('Check the value of "datadirectory" in your configuration') |
| 1034 | 1034 | ]; |
| 1035 | 1035 | } |
| 1036 | - if (!file_exists($dataDirectory . '/.ocdata')) { |
|
| 1036 | + if (!file_exists($dataDirectory.'/.ocdata')) { |
|
| 1037 | 1037 | $errors[] = [ |
| 1038 | 1038 | 'error' => $l->t('Your data directory is invalid'), |
| 1039 | - 'hint' => $l->t('Ensure there is a file called ".ocdata"' . |
|
| 1039 | + 'hint' => $l->t('Ensure there is a file called ".ocdata"'. |
|
| 1040 | 1040 | ' in the root of the data directory.') |
| 1041 | 1041 | ]; |
| 1042 | 1042 | } |
@@ -1052,7 +1052,7 @@ discard block |
||
| 1052 | 1052 | public static function checkLoggedIn() { |
| 1053 | 1053 | // Check if we are a user |
| 1054 | 1054 | if (!\OC::$server->getUserSession()->isLoggedIn()) { |
| 1055 | - header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute( |
|
| 1055 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRoute( |
|
| 1056 | 1056 | 'core.login.showLoginForm', |
| 1057 | 1057 | [ |
| 1058 | 1058 | 'redirect_url' => \OC::$server->getRequest()->getRequestUri(), |
@@ -1063,7 +1063,7 @@ discard block |
||
| 1063 | 1063 | } |
| 1064 | 1064 | // Redirect to 2FA challenge selection if 2FA challenge was not solved yet |
| 1065 | 1065 | if (\OC::$server->getTwoFactorAuthManager()->needsSecondFactor(\OC::$server->getUserSession()->getUser())) { |
| 1066 | - header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge')); |
|
| 1066 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge')); |
|
| 1067 | 1067 | exit(); |
| 1068 | 1068 | } |
| 1069 | 1069 | } |
@@ -1076,7 +1076,7 @@ discard block |
||
| 1076 | 1076 | public static function checkAdminUser() { |
| 1077 | 1077 | OC_Util::checkLoggedIn(); |
| 1078 | 1078 | if (!OC_User::isAdminUser(OC_User::getUser())) { |
| 1079 | - header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php')); |
|
| 1079 | + header('Location: '.\OCP\Util::linkToAbsolute('', 'index.php')); |
|
| 1080 | 1080 | exit(); |
| 1081 | 1081 | } |
| 1082 | 1082 | } |
@@ -1090,12 +1090,12 @@ discard block |
||
| 1090 | 1090 | OC_Util::checkLoggedIn(); |
| 1091 | 1091 | $userObject = \OC::$server->getUserSession()->getUser(); |
| 1092 | 1092 | $isSubAdmin = false; |
| 1093 | - if($userObject !== null) { |
|
| 1093 | + if ($userObject !== null) { |
|
| 1094 | 1094 | $isSubAdmin = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdmin($userObject); |
| 1095 | 1095 | } |
| 1096 | 1096 | |
| 1097 | 1097 | if (!$isSubAdmin) { |
| 1098 | - header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php')); |
|
| 1098 | + header('Location: '.\OCP\Util::linkToAbsolute('', 'index.php')); |
|
| 1099 | 1099 | exit(); |
| 1100 | 1100 | } |
| 1101 | 1101 | return true; |
@@ -1132,10 +1132,10 @@ discard block |
||
| 1132 | 1132 | } |
| 1133 | 1133 | } |
| 1134 | 1134 | |
| 1135 | - if($config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true') { |
|
| 1136 | - $location = $urlGenerator->getAbsoluteURL('/apps/' . $appId . '/'); |
|
| 1135 | + if ($config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true') { |
|
| 1136 | + $location = $urlGenerator->getAbsoluteURL('/apps/'.$appId.'/'); |
|
| 1137 | 1137 | } else { |
| 1138 | - $location = $urlGenerator->getAbsoluteURL('/index.php/apps/' . $appId . '/'); |
|
| 1138 | + $location = $urlGenerator->getAbsoluteURL('/index.php/apps/'.$appId.'/'); |
|
| 1139 | 1139 | } |
| 1140 | 1140 | } |
| 1141 | 1141 | } |
@@ -1149,7 +1149,7 @@ discard block |
||
| 1149 | 1149 | */ |
| 1150 | 1150 | public static function redirectToDefaultPage() { |
| 1151 | 1151 | $location = self::getDefaultPageUrl(); |
| 1152 | - header('Location: ' . $location); |
|
| 1152 | + header('Location: '.$location); |
|
| 1153 | 1153 | exit(); |
| 1154 | 1154 | } |
| 1155 | 1155 | |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | $id = \OC::$server->getSystemConfig()->getValue('instanceid', null); |
| 1163 | 1163 | if (is_null($id)) { |
| 1164 | 1164 | // We need to guarantee at least one letter in instanceid so it can be used as the session_name |
| 1165 | - $id = 'oc' . \OC::$server->getSecureRandom()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS); |
|
| 1165 | + $id = 'oc'.\OC::$server->getSecureRandom()->generate(10, \OCP\Security\ISecureRandom::CHAR_LOWER.\OCP\Security\ISecureRandom::CHAR_DIGITS); |
|
| 1166 | 1166 | \OC::$server->getSystemConfig()->setValue('instanceid', $id); |
| 1167 | 1167 | } |
| 1168 | 1168 | return $id; |
@@ -1184,7 +1184,7 @@ discard block |
||
| 1184 | 1184 | }, $value); |
| 1185 | 1185 | } else { |
| 1186 | 1186 | // Specify encoding for PHP<5.4 |
| 1187 | - $value = htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8'); |
|
| 1187 | + $value = htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8'); |
|
| 1188 | 1188 | } |
| 1189 | 1189 | return $value; |
| 1190 | 1190 | } |
@@ -1217,7 +1217,7 @@ discard block |
||
| 1217 | 1217 | $testContent = 'This is used for testing whether htaccess is properly enabled to disallow access from the outside. This file can be safely removed.'; |
| 1218 | 1218 | |
| 1219 | 1219 | // creating a test file |
| 1220 | - $testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName; |
|
| 1220 | + $testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT.'/data').'/'.$fileName; |
|
| 1221 | 1221 | |
| 1222 | 1222 | if (file_exists($testFile)) {// already running this test, possible recursive call |
| 1223 | 1223 | return false; |
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | $fp = @fopen($testFile, 'w'); |
| 1227 | 1227 | if (!$fp) { |
| 1228 | 1228 | throw new OC\HintException('Can\'t create test file to check for working .htaccess file.', |
| 1229 | - 'Make sure it is possible for the webserver to write to ' . $testFile); |
|
| 1229 | + 'Make sure it is possible for the webserver to write to '.$testFile); |
|
| 1230 | 1230 | } |
| 1231 | 1231 | fwrite($fp, $testContent); |
| 1232 | 1232 | fclose($fp); |
@@ -1253,10 +1253,10 @@ discard block |
||
| 1253 | 1253 | } |
| 1254 | 1254 | |
| 1255 | 1255 | $fileName = '/htaccesstest.txt'; |
| 1256 | - $testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName; |
|
| 1256 | + $testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT.'/data').'/'.$fileName; |
|
| 1257 | 1257 | |
| 1258 | 1258 | // accessing the file via http |
| 1259 | - $url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT . '/data' . $fileName); |
|
| 1259 | + $url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT.'/data'.$fileName); |
|
| 1260 | 1260 | try { |
| 1261 | 1261 | $content = \OC::$server->getHTTPClientService()->newClient()->get($url)->getBody(); |
| 1262 | 1262 | } catch (\Exception $e) { |
@@ -1347,7 +1347,7 @@ discard block |
||
| 1347 | 1347 | $theme = \OC::$server->getSystemConfig()->getValue("theme", ''); |
| 1348 | 1348 | |
| 1349 | 1349 | if ($theme === '') { |
| 1350 | - if (is_dir(OC::$SERVERROOT . '/themes/default')) { |
|
| 1350 | + if (is_dir(OC::$SERVERROOT.'/themes/default')) { |
|
| 1351 | 1351 | $theme = 'default'; |
| 1352 | 1352 | } |
| 1353 | 1353 | } |
@@ -1420,13 +1420,13 @@ discard block |
||
| 1420 | 1420 | * @return bool|string |
| 1421 | 1421 | */ |
| 1422 | 1422 | public static function normalizeUnicode($value) { |
| 1423 | - if(Normalizer::isNormalized($value)) { |
|
| 1423 | + if (Normalizer::isNormalized($value)) { |
|
| 1424 | 1424 | return $value; |
| 1425 | 1425 | } |
| 1426 | 1426 | |
| 1427 | 1427 | $normalizedValue = Normalizer::normalize($value); |
| 1428 | 1428 | if ($normalizedValue === null || $normalizedValue === false) { |
| 1429 | - \OC::$server->getLogger()->warning('normalizing failed for "' . $value . '"', ['app' => 'core']); |
|
| 1429 | + \OC::$server->getLogger()->warning('normalizing failed for "'.$value.'"', ['app' => 'core']); |
|
| 1430 | 1430 | return $value; |
| 1431 | 1431 | } |
| 1432 | 1432 | |
@@ -1442,7 +1442,7 @@ discard block |
||
| 1442 | 1442 | $version = OC_Util::getVersionString(); |
| 1443 | 1443 | $build = OC_Util::getBuild(); |
| 1444 | 1444 | if (!empty($build) and OC_Util::getChannel() === 'daily') { |
| 1445 | - $version .= ' Build:' . $build; |
|
| 1445 | + $version .= ' Build:'.$build; |
|
| 1446 | 1446 | } |
| 1447 | 1447 | return $version; |
| 1448 | 1448 | } |
@@ -1464,7 +1464,7 @@ discard block |
||
| 1464 | 1464 | } |
| 1465 | 1465 | |
| 1466 | 1466 | // detect part files |
| 1467 | - if (preg_match('/' . \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX . '/', $trimmed) !== 0) { |
|
| 1467 | + if (preg_match('/'.\OCP\Files\FileInfo::BLACKLIST_FILES_REGEX.'/', $trimmed) !== 0) { |
|
| 1468 | 1468 | return false; |
| 1469 | 1469 | } |
| 1470 | 1470 | |
@@ -1495,19 +1495,19 @@ discard block |
||
| 1495 | 1495 | } else if ($config->getValue('debug', false) && $versionDiff < 0) { |
| 1496 | 1496 | // downgrade with debug |
| 1497 | 1497 | $installedMajor = explode('.', $installedVersion); |
| 1498 | - $installedMajor = $installedMajor[0] . '.' . $installedMajor[1]; |
|
| 1498 | + $installedMajor = $installedMajor[0].'.'.$installedMajor[1]; |
|
| 1499 | 1499 | $currentMajor = explode('.', $currentVersion); |
| 1500 | - $currentMajor = $currentMajor[0] . '.' . $currentMajor[1]; |
|
| 1500 | + $currentMajor = $currentMajor[0].'.'.$currentMajor[1]; |
|
| 1501 | 1501 | if ($installedMajor === $currentMajor) { |
| 1502 | 1502 | // Same major, allow downgrade for developers |
| 1503 | 1503 | return true; |
| 1504 | 1504 | } else { |
| 1505 | 1505 | // downgrade attempt, throw exception |
| 1506 | - throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')'); |
|
| 1506 | + throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from '.$installedVersion.' to '.$currentVersion.')'); |
|
| 1507 | 1507 | } |
| 1508 | 1508 | } else if ($versionDiff < 0) { |
| 1509 | 1509 | // downgrade attempt, throw exception |
| 1510 | - throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')'); |
|
| 1510 | + throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from '.$installedVersion.' to '.$currentVersion.')'); |
|
| 1511 | 1511 | } |
| 1512 | 1512 | |
| 1513 | 1513 | // also check for upgrades for apps (independently from the user) |