[-] 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:
+32
-2
@@ -69,5 +69,35 @@ if (!@ini_get('date.timezone'))
|
|||||||
@date_default_timezone_set('UTC');
|
@date_default_timezone_set('UTC');
|
||||||
|
|
||||||
// Try to improve memory limit if it's under 32M
|
// Try to improve memory limit if it's under 32M
|
||||||
if (Tools::getMemoryLimit() < Tools::getOctets('32M'))
|
if (psinstall_get_memory_limit() < psinstall_get_octets('32M'))
|
||||||
ini_set('memory_limit', '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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user