Merged in bugfix/PMC-402 (pull request #6966)

PMC-402

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Paula Quispe
2019-07-11 15:05:43 +00:00
committed by Julio Cesar Laura Avendaño
10 changed files with 82 additions and 12 deletions

View File

@@ -196,7 +196,7 @@ class FilesLogs extends Files
*/
private function size($size, $format = null)
{
$sizes = ['Bytes', 'Kbytes', 'Mbytes', 'Gbytes', 'Tbytes', 'Pbytes', 'Ebytes', 'Zbytes', 'Ybytes'];
$sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
if ($format === null) {
$format = ' % 01.2f % s';
}

23
workflow/engine/src/ProcessMaker/Util/helpers.php Normal file → Executable file
View File

@@ -451,6 +451,29 @@ function replacePrefixes($outDocFilename, $prefix = '@=')
return $outDocFile;
}
/**
* Change the abbreviation of directives used in the php.ini configuration
*
* @param string $size
*
* @return string
*/
function changeAbbreviationOfDirectives($size)
{
$sizeValue = (int)$size;
switch (substr($size, -1)) {
case 'K':
return $sizeValue . 'KB';
case 'M':
return $sizeValue . 'MB';
case 'G':
return $sizeValue . 'GB';
default:
return $sizeValue . 'Bytes';
}
}
/**
* Encoding header filename used in Content-Disposition
*