From 379875ee64d13f2a69a7cb158c84b288300fdbd4 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Wed, 6 Apr 2016 14:31:38 +0200 Subject: [PATCH] Fix case of called functions/methods --- wcfsetup/install.php | 12 ++--- .../files/lib/data/user/UserProfile.class.php | 2 +- .../BackgroundQueueHandler.class.php | 2 +- .../cache/source/RedisCacheSource.class.php | 6 +-- .../system/condition/TimeCondition.class.php | 2 +- .../BackgroundQueueCleanUpCronjob.class.php | 2 +- .../lib/system/database/Database.class.php | 2 +- .../files/lib/system/email/Email.class.php | 2 +- .../image/adapter/GDImageAdapter.class.php | 50 +++++++++---------- .../install/files/lib/system/io/Tar.class.php | 12 ++--- .../files/lib/system/io/TarWriter.class.php | 18 +++---- .../option/FileSizeOptionType.class.php | 2 +- .../SQLPackageInstallationPlugin.class.php | 2 +- .../lib/system/upload/UploadFile.class.php | 2 +- .../user/storage/UserStorageHandler.class.php | 2 +- wcfsetup/install/files/lib/util/XML.class.php | 2 +- .../files/lib/util/XMLWriter.class.php | 2 +- 17 files changed, 61 insertions(+), 61 deletions(-) diff --git a/wcfsetup/install.php b/wcfsetup/install.php index de5a1789d3..c76427517e 100644 --- a/wcfsetup/install.php +++ b/wcfsetup/install.php @@ -642,14 +642,14 @@ class Tar { $data = unpack($format, $binaryData); // Extract the properties - $header['checksum'] = octDec(trim($data['checksum'])); + $header['checksum'] = octdec(trim($data['checksum'])); if ($header['checksum'] == $checksum) { $header['filename'] = trim($data['filename']); - $header['mode'] = octDec(trim($data['mode'])); - $header['uid'] = octDec(trim($data['uid'])); - $header['gid'] = octDec(trim($data['gid'])); - $header['size'] = octDec(trim($data['size'])); - $header['mtime'] = octDec(trim($data['mtime'])); + $header['mode'] = octdec(trim($data['mode'])); + $header['uid'] = octdec(trim($data['uid'])); + $header['gid'] = octdec(trim($data['gid'])); + $header['size'] = octdec(trim($data['size'])); + $header['mtime'] = octdec(trim($data['mtime'])); $header['prefix'] = trim($data['prefix']); if ($header['prefix']) { $header['filename'] = $header['prefix'].'/'.$header['filename']; diff --git a/wcfsetup/install/files/lib/data/user/UserProfile.class.php b/wcfsetup/install/files/lib/data/user/UserProfile.class.php index 6c303c5b14..ff892341de 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfile.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfile.class.php @@ -831,7 +831,7 @@ class UserProfile extends DatabaseObjectDecorator implements IBreadcrumbProvider public function getAnchorTag() { $link = LinkHandler::getInstance()->getLink('User', ['object' => $this->getDecoratedObject()]); - return ''.StringUtil::encodeHtml($this->username).''; + return ''.StringUtil::encodeHTML($this->username).''; } /** diff --git a/wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php b/wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php index 3ed9eb88fa..c08579f0f7 100644 --- a/wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php +++ b/wcfsetup/install/files/lib/system/background/BackgroundQueueHandler.class.php @@ -169,7 +169,7 @@ class BackgroundQueueHandler extends SingletonFactory { $commited = true; } finally { - if (!$commited) WCF::getDB()->rollbackTransaction(); + if (!$commited) WCF::getDB()->rollBackTransaction(); } $job = null; diff --git a/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php b/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php index 7848d4f183..4b33a51183 100644 --- a/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php +++ b/wcfsetup/install/files/lib/system/cache/source/RedisCacheSource.class.php @@ -76,7 +76,7 @@ class RedisCacheSource implements ICacheSource { } else { // delete the specified key from the hashset - $this->redis->hdel($this->getCacheName($parts[0]), $parts[1]); + $this->redis->hDel($this->getCacheName($parts[0]), $parts[1]); } } else { @@ -102,7 +102,7 @@ class RedisCacheSource implements ICacheSource { $parts = explode('-', $cacheName, 2); if (isset($parts[1])) { - $value = $this->redis->hget($this->getCacheName($parts[0]), $parts[1]); + $value = $this->redis->hGet($this->getCacheName($parts[0]), $parts[1]); } else { $value = $this->redis->get($this->getCacheName($cacheName)); @@ -149,7 +149,7 @@ class RedisCacheSource implements ICacheSource { // save parameterized cache entries as field in a hashset // saving in a hashset is safe as the smallest lifetime of its fields is set as TTL for the whole hashset - $this->redis->hset($key, $parts[1], serialize($value)); + $this->redis->hSet($key, $parts[1], serialize($value)); $keyTTL = $this->redis->ttl($key); $newTTL = $this->getTTL($maxLifetime); diff --git a/wcfsetup/install/files/lib/system/condition/TimeCondition.class.php b/wcfsetup/install/files/lib/system/condition/TimeCondition.class.php index 1844b9b0d9..5d8ec76e05 100644 --- a/wcfsetup/install/files/lib/system/condition/TimeCondition.class.php +++ b/wcfsetup/install/files/lib/system/condition/TimeCondition.class.php @@ -166,7 +166,7 @@ HTML; } if ($startDateTime !== null && $endDateTime !== null) { - if ($startDateTime->getTimestamp() >= $endDateTime->getTimeStamp()) { + if ($startDateTime->getTimestamp() >= $endDateTime->getTimestamp()) { $this->errorMessages['time'] = 'wcf.date.endTime.error.beforeStartTime'; throw new UserInputException('endTime', 'beforeStartTime'); diff --git a/wcfsetup/install/files/lib/system/cronjob/BackgroundQueueCleanUpCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/BackgroundQueueCleanUpCronjob.class.php index b5caf9d854..c028f2c138 100644 --- a/wcfsetup/install/files/lib/system/cronjob/BackgroundQueueCleanUpCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/BackgroundQueueCleanUpCronjob.class.php @@ -76,7 +76,7 @@ class BackgroundQueueCleanUpCronjob extends AbstractCronjob { $commited = true; } finally { - if (!$commited) WCF::getDB()->rollbackTransaction(); + if (!$commited) WCF::getDB()->rollBackTransaction(); } } } diff --git a/wcfsetup/install/files/lib/system/database/Database.class.php b/wcfsetup/install/files/lib/system/database/Database.class.php index 91eb805864..bd4913ca5b 100644 --- a/wcfsetup/install/files/lib/system/database/Database.class.php +++ b/wcfsetup/install/files/lib/system/database/Database.class.php @@ -198,7 +198,7 @@ abstract class Database { $this->activeTransactions--; if ($this->activeTransactions === 0) { if (WCF::benchmarkIsEnabled()) Benchmark::getInstance()->start("ROLLBACK", Benchmark::TYPE_SQL_QUERY); - $result = $this->pdo->rollback(); + $result = $this->pdo->rollBack(); } else { if (WCF::benchmarkIsEnabled()) Benchmark::getInstance()->start("ROLLBACK TO SAVEPOINT level".$this->activeTransactions, Benchmark::TYPE_SQL_QUERY); diff --git a/wcfsetup/install/files/lib/system/email/Email.class.php b/wcfsetup/install/files/lib/system/email/Email.class.php index 0822fca226..ffd558bb91 100644 --- a/wcfsetup/install/files/lib/system/email/Email.class.php +++ b/wcfsetup/install/files/lib/system/email/Email.class.php @@ -513,7 +513,7 @@ class Email { $body = ""; if (count($this->text) > 1 || $this->attachments) { - $body .= StringUtil::wordWrap("This is a MIME encoded email. As you are seeing this your user agent does not support these."); + $body .= StringUtil::wordwrap("This is a MIME encoded email. As you are seeing this your user agent does not support these."); $body .= "\r\n\r\n"; } diff --git a/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php b/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php index 1ab8ed2cb0..244f34bab6 100644 --- a/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php +++ b/wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php @@ -65,27 +65,27 @@ class GDImageAdapter implements IImageAdapter { $this->image = $image; $this->type = $type; - $this->height = imageSY($this->image); - $this->width = imageSX($this->image); + $this->height = imagesy($this->image); + $this->width = imagesx($this->image); } /** * @see \wcf\system\image\adapter\IImageAdapter::loadFile() */ public function loadFile($file) { - list($this->width, $this->height, $this->type) = getImageSize($file); + list($this->width, $this->height, $this->type) = getimagesize($file); switch ($this->type) { case IMAGETYPE_GIF: - $this->image = imageCreateFromGif($file); + $this->image = imagecreatefromgif($file); break; case IMAGETYPE_JPEG: - $this->image = imageCreateFromJpeg($file); + $this->image = imagecreatefromjpeg($file); break; case IMAGETYPE_PNG: - $this->image = imageCreateFromPng($file); + $this->image = imagecreatefrompng($file); break; default: @@ -98,7 +98,7 @@ class GDImageAdapter implements IImageAdapter { * @see \wcf\system\image\adapter\IImageAdapter::createEmptyImage() */ public function createEmptyImage($width, $height) { - $this->image = imageCreate($width, $height); + $this->image = imagecreate($width, $height); $this->type = IMAGETYPE_PNG; $this->setColor(0xFF, 0xFF, 0xFF); $this->color = null; @@ -139,10 +139,10 @@ class GDImageAdapter implements IImageAdapter { } // resize image - $image = imageCreateTrueColor($width, $height); - imageAlphaBlending($image, false); - imageCopyResampled($image, $this->image, 0, 0, $x, $y, $width, $height, $sourceWidth, $sourceHeight); - imageSaveAlpha($image, true); + $image = imagecreatetruecolor($width, $height); + imagealphablending($image, false); + imagecopyresampled($image, $this->image, 0, 0, $x, $y, $width, $height, $sourceWidth, $sourceHeight); + imagesavealpha($image, true); return $image; } @@ -151,11 +151,11 @@ class GDImageAdapter implements IImageAdapter { * @see \wcf\system\image\adapter\IImageAdapter::clip() */ public function clip($originX, $originY, $width, $height) { - $image = imageCreateTrueColor($width, $height); - imageAlphaBlending($image, false); + $image = imagecreatetruecolor($width, $height); + imagealphablending($image, false); - imageCopy($image, $this->image, 0, 0, $originX, $originY, $width, $height); - imageSaveAlpha($image, true); + imagecopy($image, $this->image, 0, 0, $originX, $originY, $width, $height); + imagesavealpha($image, true); // reload image to update image resource, width and height $this->load($image, $this->type); @@ -165,11 +165,11 @@ class GDImageAdapter implements IImageAdapter { * @see \wcf\system\image\adapter\IImageAdapter::resize() */ public function resize($originX, $originY, $originWidth, $originHeight, $targetWidth = 0, $targetHeight = 0) { - $image = imageCreateTrueColor($targetWidth, $targetHeight); - imageAlphaBlending($image, false); + $image = imagecreatetruecolor($targetWidth, $targetHeight); + imagealphablending($image, false); - imageCopyResampled($image, $this->image, 0, 0, $originX, $originY, $targetWidth, $targetHeight, $originWidth, $originHeight); - imageSaveAlpha($image, true); + imagecopyresampled($image, $this->image, 0, 0, $originX, $originY, $targetWidth, $targetHeight, $originWidth, $originHeight); + imagesavealpha($image, true); // reload image to update image resource, width and height $this->load($image, $this->type); @@ -179,7 +179,7 @@ class GDImageAdapter implements IImageAdapter { * @see \wcf\system\image\adapter\IImageAdapter::drawRectangle() */ public function drawRectangle($startX, $startY, $endX, $endY) { - imageFilledRectangle($this->image, $startX, $startY, $endX, $endY, $this->color); + imagefilledrectangle($this->image, $startX, $startY, $endX, $endY, $this->color); } /** @@ -277,7 +277,7 @@ class GDImageAdapter implements IImageAdapter { * @see \wcf\system\image\adapter\IImageAdapter::setColor() */ public function setColor($red, $green, $blue) { - $this->color = imageColorAllocate($this->image, $red, $green, $blue); + $this->color = imagecolorallocate($this->image, $red, $green, $blue); // save data of the color $this->colorData = array( @@ -300,7 +300,7 @@ class GDImageAdapter implements IImageAdapter { public function setTransparentColor($red, $green, $blue) { if ($this->type == IMAGETYPE_PNG) { $color = imagecolorallocate($this->image, $red, $green, $blue); - imageColorTransparent($this->image, $color); + imagecolortransparent($this->image, $color); } } @@ -315,13 +315,13 @@ class GDImageAdapter implements IImageAdapter { ob_start(); if ($this->type == IMAGETYPE_GIF) { - imageGIF($image); + imagegif($image); } else if ($this->type == IMAGETYPE_PNG) { - imagePNG($image); + imagepng($image); } else if (function_exists('imageJPEG')) { - imageJPEG($image, null, 90); + imagejpeg($image, null, 90); } $stream = ob_get_contents(); diff --git a/wcfsetup/install/files/lib/system/io/Tar.class.php b/wcfsetup/install/files/lib/system/io/Tar.class.php index 26377be43e..4953a666d7 100644 --- a/wcfsetup/install/files/lib/system/io/Tar.class.php +++ b/wcfsetup/install/files/lib/system/io/Tar.class.php @@ -314,14 +314,14 @@ class Tar implements IArchive { $data = unpack($format, $binaryData); // Extract the properties - $header['checksum'] = octDec(trim($data['checksum'])); + $header['checksum'] = octdec(trim($data['checksum'])); if ($header['checksum'] == $checksum) { $header['filename'] = trim($data['filename']); - $header['mode'] = octDec(trim($data['mode'])); - $header['uid'] = octDec(trim($data['uid'])); - $header['gid'] = octDec(trim($data['gid'])); - $header['size'] = octDec(trim($data['size'])); - $header['mtime'] = octDec(trim($data['mtime'])); + $header['mode'] = octdec(trim($data['mode'])); + $header['uid'] = octdec(trim($data['uid'])); + $header['gid'] = octdec(trim($data['gid'])); + $header['size'] = octdec(trim($data['size'])); + $header['mtime'] = octdec(trim($data['mtime'])); $header['prefix'] = trim($data['prefix']); if ($header['prefix']) { $header['filename'] = $header['prefix'].'/'.$header['filename']; diff --git a/wcfsetup/install/files/lib/system/io/TarWriter.class.php b/wcfsetup/install/files/lib/system/io/TarWriter.class.php index 496654ac81..b95e2f7951 100644 --- a/wcfsetup/install/files/lib/system/io/TarWriter.class.php +++ b/wcfsetup/install/files/lib/system/io/TarWriter.class.php @@ -217,16 +217,16 @@ class TarWriter extends Tar { } if ($typeFlag == "5") { - $size = sprintf("%11s ", decOct(0)); + $size = sprintf("%11s ", decoct(0)); } else { - $size = sprintf("%11s ", decOct($size)); + $size = sprintf("%11s ", decoct($size)); } - $uid = sprintf("%6s ", decOct($uid)); - $gid = sprintf("%6s ", decOct($gid)); - $permissions = sprintf("%6s ", decOct($permissions)); - $mtime = sprintf("%11s", decOct($mtime)); + $uid = sprintf("%6s ", decoct($uid)); + $gid = sprintf("%6s ", decoct($gid)); + $permissions = sprintf("%6s ", decoct($permissions)); + $mtime = sprintf("%11s", decoct($mtime)); $binaryDataFirst = pack('a100a8a8a8a12A12', $filename, $permissions, $uid, $gid, $size, $mtime); $binaryDataLast = pack('a1a100a6a2a32a32a8a8a155a12', $typeFlag, '', '', '', '', '', '', '', '', ''); @@ -244,7 +244,7 @@ class TarWriter extends Tar { } $this->file->write($binaryDataFirst, 148); - $this->file->write(pack('a8', sprintf("%6s ", decOct($checksum))), 8); // write the checksum + $this->file->write(pack('a8', sprintf("%6s ", decoct($checksum))), 8); // write the checksum $this->file->write($binaryDataLast, 356); return true; @@ -257,7 +257,7 @@ class TarWriter extends Tar { * @return boolean */ protected function writeLongHeaderBlock($filename) { - $size = sprintf("%11s ", decOct(strlen($filename))); + $size = sprintf("%11s ", decoct(strlen($filename))); $typeFlag = 'L'; $binaryDataFirst = pack('a100a8a8a8a12A12', '././@LongLink', 0, 0, 0, $size, 0); @@ -276,7 +276,7 @@ class TarWriter extends Tar { } $this->file->write($binaryDataFirst, 148); - $this->file->write(pack('a8', sprintf("%6s ", decOct($checksum))), 8); // write the checksum + $this->file->write(pack('a8', sprintf("%6s ", decoct($checksum))), 8); // write the checksum $this->file->write($binaryDataLast, 356); $i = 0; diff --git a/wcfsetup/install/files/lib/system/option/FileSizeOptionType.class.php b/wcfsetup/install/files/lib/system/option/FileSizeOptionType.class.php index b638df31f2..0fee86ee7a 100644 --- a/wcfsetup/install/files/lib/system/option/FileSizeOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/FileSizeOptionType.class.php @@ -60,7 +60,7 @@ class FileSizeOptionType extends TextOptionType { * @see \wcf\system\option\IOptionType::getFormElement() */ public function getFormElement(Option $option, $value) { - $value = FileUtil::formatFileSize($value); + $value = FileUtil::formatFilesize($value); return parent::getFormElement($option, $value); } diff --git a/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php index 29516a2d1a..5c4f2b9a09 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php @@ -99,7 +99,7 @@ class SQLPackageInstallationPlugin extends AbstractPackageInstallationPlugin { } // get all tablenames from database - $existingTableNames = WCF::getDB()->getEditor()->getTablenames(); + $existingTableNames = WCF::getDB()->getEditor()->getTableNames(); // delete or alter tables foreach ($entries as $entry) { diff --git a/wcfsetup/install/files/lib/system/upload/UploadFile.class.php b/wcfsetup/install/files/lib/system/upload/UploadFile.class.php index a760aaf297..afe67ffba7 100644 --- a/wcfsetup/install/files/lib/system/upload/UploadFile.class.php +++ b/wcfsetup/install/files/lib/system/upload/UploadFile.class.php @@ -168,7 +168,7 @@ class UploadFile { */ public function getImageData() { if (strpos($this->getMimeType(), 'image/') == 0) { - if (($imageData = @getImageSize($this->getLocation())) !== false) { + if (($imageData = @getimagesize($this->getLocation())) !== false) { return array( 'width' => $imageData[0], 'height' => $imageData[1], diff --git a/wcfsetup/install/files/lib/system/user/storage/UserStorageHandler.class.php b/wcfsetup/install/files/lib/system/user/storage/UserStorageHandler.class.php index 60d6e3dd18..2ebe2883d4 100644 --- a/wcfsetup/install/files/lib/system/user/storage/UserStorageHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/storage/UserStorageHandler.class.php @@ -248,7 +248,7 @@ class UserStorageHandler extends SingletonFactory { break; } catch (\Exception $e) { - WCF::getDB()->rollbackTransaction(); + WCF::getDB()->rollBackTransaction(); // retry up to 2 times if (++$i === 2) { diff --git a/wcfsetup/install/files/lib/util/XML.class.php b/wcfsetup/install/files/lib/util/XML.class.php index 42cb4e936a..a30359320a 100644 --- a/wcfsetup/install/files/lib/util/XML.class.php +++ b/wcfsetup/install/files/lib/util/XML.class.php @@ -110,7 +110,7 @@ class XML { */ protected function getSchema() { // determine schema by looking for xsi:schemaLocation - $this->schema = $this->document->documentElement->getAttributeNS($this->document->documentElement->lookupNamespaceURI('xsi'), 'schemaLocation'); + $this->schema = $this->document->documentElement->getAttributeNS($this->document->documentElement->lookupNamespaceUri('xsi'), 'schemaLocation'); // no valid schema found or it's lacking a valid namespace if (strpos($this->schema, ' ') === false) { diff --git a/wcfsetup/install/files/lib/util/XMLWriter.class.php b/wcfsetup/install/files/lib/util/XMLWriter.class.php index d2bb4907aa..2e78be509c 100644 --- a/wcfsetup/install/files/lib/util/XMLWriter.class.php +++ b/wcfsetup/install/files/lib/util/XMLWriter.class.php @@ -130,7 +130,7 @@ class XMLWriter { } // content - $this->xml->writeCData(StringUtil::escapeCDATA($cdata)); + $this->xml->writeCdata(StringUtil::escapeCDATA($cdata)); $this->endElement(); } -- 2.20.1