Pagekit\Installer\Helper\Composer::memoryInBytes PHP Method

memoryInBytes() protected method

Converts memory value from 'php.ini' into bytes.
protected memoryInBytes ( $value ) : integer
$value
return integer
    protected function memoryInBytes($value)
    {
        $unit = strtolower(substr($value, -1, 1));
        $value = (int) $value;
        switch ($unit) {
            case 'g':
                $value *= 1024;
                // no break (cumulative multiplier)
            // no break (cumulative multiplier)
            case 'm':
                $value *= 1024;
                // no break (cumulative multiplier)
            // no break (cumulative multiplier)
            case 'k':
                $value *= 1024;
        }
        return $value;
    }