[-] Installer : removed calls to Tools in installer (replace by local function) #PSCFV-4113

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17430 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger
2012-09-20 09:49:41 +00:00
parent 5a923f6605
commit f35027b4fd
+32 -2
View File
@@ -69,5 +69,35 @@ if (!@ini_get('date.timezone'))
@date_default_timezone_set('UTC');
// Try to improve memory limit if it's under 32M
if (Tools::getMemoryLimit() < Tools::getOctets('32M'))
ini_set('memory_limit', '32M');
if (psinstall_get_memory_limit() < psinstall_get_octets('32M'))
ini_set('memory_limit', '32M');
function psinstall_get_octets($option)
{
if (preg_match('/[0-9]+k/i', $option))
return 1024 * (int)$option;
if (preg_match('/[0-9]+m/i', $option))
return 1024 * 1024 * (int)$option;
if (preg_match('/[0-9]+g/i', $option))
return 1024 * 1024 * 1024 * (int)$option;
return $option;
}
function psinstall_get_memory_limit()
{
$memory_limit = @ini_get('memory_limit');
if (preg_match('/[0-9]+k/i', $memory_limit))
return 1024 * (int)$memory_limit;
if (preg_match('/[0-9]+m/i', $memory_limit))
return 1024 * 1024 * (int)$memory_limit;
if (preg_match('/[0-9]+g/i', $memory_limit))
return 1024 * 1024 * 1024 * (int)$memory_limit;
return $memory_limit;
}