Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * getMemoryLimit allow to get the memory limit in octet
- *
- * @since 1.4.5.0
- * @return int the memory limit value in octet
- */
- public static function getMemoryLimit()
- {
- $memory_limit = @ini_get('memory_limit');
- return Tools::getOctets($memory_limit);
- }
- /**
- * getOctet allow to gets the value of a configuration option in octet
- *
- * @since 1.5.0
- * @return int the value of a configuration option in octet
- */
- public static function getOctets($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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement