ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | |
__construct ($size, $unit) | |
DataSize constructor. More... | |
getSize () | |
The calculated data size. More... | |
getUnit () | |
The unit which equals the class constant used to calculate the data size. More... | |
__toString () | |
Returns the data size with the corresponding suffix. More... | |
Data Fields | |
const | Byte = 1 |
const | KiB = 1024 |
const | MiB = 1048576 |
const | GiB = 1073741824 |
const | TiB = 1099511627776 |
const | PiB = 1125899906842624 |
const | EiB = 1152921504606846976 |
const | ZiB = 1180591620717411303424 |
const | YiB = 1208925819614629174706176 |
const | KB = 1000 |
const | MB = 1000000 |
const | GB = 1000000000 |
const | TB = 1000000000000 |
const | PB = 1000000000000000 |
const | EB = 1000000000000000000 |
const | ZB = 1000000000000000000000 |
const | YB = 1000000000000000000000000 |
Private Attributes | |
$size | |
$unit | |
$suffix | |
Static Private Attributes | |
static | $suffixMap |
Class DataSize.
This class provides the data size with additional information to remove the work to calculate the size to different unit like GiB, GB usw.
Definition at line 15 of file DataSize.php.
ILIAS\Data\DataSize::__construct | ( | $size, | |
$unit | |||
) |
DataSize constructor.
int | $size | The data size in bytes. |
int | $unit | The unit which is used to calculate the data size. |
Definition at line 91 of file DataSize.php.
References ILIAS\Data\DataSize\$size, ILIAS\Data\DataSize\$unit, and size.
ILIAS\Data\DataSize::__toString | ( | ) |
Returns the data size with the corresponding suffix.
Example output: 1024 B 4096 GiB
Definition at line 143 of file DataSize.php.
ILIAS\Data\DataSize::getSize | ( | ) |
The calculated data size.
Definition at line 116 of file DataSize.php.
References ILIAS\Data\DataSize\$size.
Referenced by ILIAS\Filesystem\Decorator\ReadOnlyDecorator\getSize(), ILIAS\Filesystem\FilesystemFacade\getSize(), ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator\getSize(), and ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess\getSize().
ILIAS\Data\DataSize::getUnit | ( | ) |
The unit which equals the class constant used to calculate the data size.
(self::GiB, ...)
Definition at line 128 of file DataSize.php.
References ILIAS\Data\DataSize\$unit.
|
private |
Definition at line 71 of file DataSize.php.
Referenced by ILIAS\Data\DataSize\__construct(), and ILIAS\Data\DataSize\getSize().
|
private |
Definition at line 79 of file DataSize.php.
|
staticprivate |
Definition at line 41 of file DataSize.php.
|
private |
Definition at line 75 of file DataSize.php.
Referenced by ILIAS\Data\DataSize\__construct(), and ILIAS\Data\DataSize\getUnit().
const ILIAS\Data\DataSize::Byte = 1 |
Definition at line 17 of file DataSize.php.
const ILIAS\Data\DataSize::EB = 1000000000000000000 |
Definition at line 35 of file DataSize.php.
const ILIAS\Data\DataSize::EiB = 1152921504606846976 |
Definition at line 25 of file DataSize.php.
const ILIAS\Data\DataSize::GB = 1000000000 |
Definition at line 32 of file DataSize.php.
const ILIAS\Data\DataSize::GiB = 1073741824 |
Definition at line 22 of file DataSize.php.
Referenced by ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest\testGetSizeWithMissingFileWhichShouldFail().
const ILIAS\Data\DataSize::KB = 1000 |
Definition at line 30 of file DataSize.php.
const ILIAS\Data\DataSize::KiB = 1024 |
Definition at line 20 of file DataSize.php.
Referenced by ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest\testGetSizeWhichShouldSucceed().
const ILIAS\Data\DataSize::MB = 1000000 |
Definition at line 31 of file DataSize.php.
const ILIAS\Data\DataSize::MiB = 1048576 |
Definition at line 21 of file DataSize.php.
Referenced by ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest\testGetSizeWithUnknownAdapterErrorWhichShouldFail().
const ILIAS\Data\DataSize::PB = 1000000000000000 |
Definition at line 34 of file DataSize.php.
const ILIAS\Data\DataSize::PiB = 1125899906842624 |
Definition at line 24 of file DataSize.php.
const ILIAS\Data\DataSize::TB = 1000000000000 |
Definition at line 33 of file DataSize.php.
const ILIAS\Data\DataSize::TiB = 1099511627776 |
Definition at line 23 of file DataSize.php.
const ILIAS\Data\DataSize::YB = 1000000000000000000000000 |
Definition at line 37 of file DataSize.php.
const ILIAS\Data\DataSize::YiB = 1208925819614629174706176 |
Definition at line 27 of file DataSize.php.
const ILIAS\Data\DataSize::ZB = 1000000000000000000000 |
Definition at line 36 of file DataSize.php.
const ILIAS\Data\DataSize::ZiB = 1180591620717411303424 |
Definition at line 26 of file DataSize.php.