1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-11 09:04:02 +02:00

Respect original memory_limit

This commit is contained in:
Jakub Vrana
2011-08-24 14:16:11 +02:00
parent 2348c4cd4c
commit 9d944c8fc1
3 changed files with 17 additions and 3 deletions

View File

@@ -366,3 +366,17 @@ function tar_file($filename, $contents) {
$return .= sprintf("%06o", $checksum) . "\0 ";
return $return . str_repeat("\0", 512 - strlen($return)) . $contents . str_repeat("\0", 511 - (strlen($contents) + 511) % 512);
}
/** Get INI bytes value
* @param string
* @return int
*/
function ini_bytes($ini) {
$val = ini_get($ini);
switch (strtolower(substr($val, -1))) {
case 'g': $val *= 1024; // no break
case 'm': $val *= 1024; // no break
case 'k': $val *= 1024;
}
return $val;
}