$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'];
public function getAnchorTag() {
$link = LinkHandler::getInstance()->getLink('User', ['object' => $this->getDecoratedObject()]);
- return '<a href="'.$link.'" class="userLink" data-user-id="'.$this->userID.'">'.StringUtil::encodeHtml($this->username).'</a>';
+ return '<a href="'.$link.'" class="userLink" data-user-id="'.$this->userID.'">'.StringUtil::encodeHTML($this->username).'</a>';
}
/**
$commited = true;
}
finally {
- if (!$commited) WCF::getDB()->rollbackTransaction();
+ if (!$commited) WCF::getDB()->rollBackTransaction();
}
$job = null;
}
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 {
$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));
// 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);
}
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');
$commited = true;
}
finally {
- if (!$commited) WCF::getDB()->rollbackTransaction();
+ if (!$commited) WCF::getDB()->rollBackTransaction();
}
}
}
$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);
$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";
}
$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:
* @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;
}
// 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;
}
* @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);
* @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);
* @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);
}
/**
* @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(
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);
}
}
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();
$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'];
}
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, '', '', '', '', '', '', '', '', '');
}
$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;
* @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);
}
$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;
* @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);
}
}
// get all tablenames from database
- $existingTableNames = WCF::getDB()->getEditor()->getTablenames();
+ $existingTableNames = WCF::getDB()->getEditor()->getTableNames();
// delete or alter tables
foreach ($entries as $entry) {
*/
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],
break;
}
catch (\Exception $e) {
- WCF::getDB()->rollbackTransaction();
+ WCF::getDB()->rollBackTransaction();
// retry up to 2 times
if (++$i === 2) {
*/
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) {
}
// content
- $this->xml->writeCData(StringUtil::escapeCDATA($cdata));
+ $this->xml->writeCdata(StringUtil::escapeCDATA($cdata));
$this->endElement();
}