1 file.test | protected FileManagedFileElementTestCase::_postMaxSizeToInteger($string) |
Converts php.ini post_max_size value to integer.
Parameters
string $string: The value from php.ini.
Return value
int: Converted value.
File
- core/
modules/ file/ tests/ file.test, line 746 - Tests for file.module.
Class
- FileManagedFileElementTestCase
- Tests the 'managed_file' element type.
Code
protected function _postMaxSizeToInteger($string) {
sscanf($string, '%u%c', $number, $suffix);
if (isset($suffix)) {
$number = $number * pow(1024, strpos(' KMG', strtoupper($suffix)));
}
return $number;
}