function FileManagedFileElementTestCase::_postMaxSizeToInteger

Converts php.ini post_max_size value to integer.

Parameters

$string: The value from php.ini.

Return value

int Converted value.

1 call to FileManagedFileElementTestCase::_postMaxSizeToInteger()
FileManagedFileElementTestCase::testManagedFileExceedMaximumFileSize in modules/file/tests/file.test
Tests uploading a file that exceeds the maximum file size.

File

modules/file/tests/file.test, line 522

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.