Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Transfer/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ public function getFileSize($files = null)
foreach ($files as $key => $value) {
if (file_exists($value['name']) || file_exists($value['tmp_name'])) {
if ($value['options']['useByteString']) {
$result[$key] = self::toByteString($value['size']);
$result[$key] = static::toByteString($value['size']);
} else {
$result[$key] = $value['size'];
}
Expand Down
16 changes: 8 additions & 8 deletions src/Transfer/Adapter/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public function isUploaded($files = null)
*/
public static function getProgress($id = null)
{
if (!self::isApcAvailable() && !self::isUploadProgressAvailable()) {
if (!static::isApcAvailable() && !static::isUploadProgressAvailable()) {
throw new Exception\PhpEnvironmentException('Neither APC nor UploadProgress extension installed');
}

Expand Down Expand Up @@ -335,14 +335,14 @@ public static function getProgress($id = null)
}

if (!empty($id)) {
if (self::isApcAvailable()) {
if (static::isApcAvailable()) {

$call = call_user_func(self::$callbackApc, ini_get('apc.rfc1867_prefix') . $id);
$call = call_user_func(static::$callbackApc, ini_get('apc.rfc1867_prefix') . $id);
if (is_array($call)) {
$status = $call + $status;
}
} elseif (self::isUploadProgressAvailable()) {
$call = call_user_func(self::$callbackUploadProgress, $id);
} elseif (static::isUploadProgressAvailable()) {
$call = call_user_func(static::$callbackUploadProgress, $id);
if (is_array($call)) {
$status = $call + $status;
$status['total'] = $status['bytes_total'];
Expand All @@ -361,7 +361,7 @@ public static function getProgress($id = null)
$status['done'] = true;
$status['message'] = 'The upload has been canceled';
} else {
$status['message'] = self::toByteString($status['current']) . " - " . self::toByteString($status['total']);
$status['message'] = static::toByteString($status['current']) . " - " . static::toByteString($status['total']);
}

$status['id'] = $id;
Expand Down Expand Up @@ -395,7 +395,7 @@ public static function getProgress($id = null)
*/
public static function isApcAvailable()
{
return (bool) ini_get('apc.enabled') && (bool) ini_get('apc.rfc1867') && is_callable(self::$callbackApc);
return (bool) ini_get('apc.enabled') && (bool) ini_get('apc.rfc1867') && is_callable(static::$callbackApc);
}

/**
Expand All @@ -405,7 +405,7 @@ public static function isApcAvailable()
*/
public static function isUploadProgressAvailable()
{
return is_callable(self::$callbackUploadProgress);
return is_callable(static::$callbackUploadProgress);
}

/**
Expand Down

0 comments on commit 099a852

Please sign in to comment.