[-] BO : no more fatal error when using Tools::apacheModExists and phpinfo() not available
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14991 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+16
-10
@@ -2014,6 +2014,9 @@ FileETag INode MTime Size
|
|||||||
* apacheModExists return true if the apache module $name is loaded
|
* apacheModExists return true if the apache module $name is loaded
|
||||||
* @TODO move this method in class Information (when it will exist)
|
* @TODO move this method in class Information (when it will exist)
|
||||||
*
|
*
|
||||||
|
* Notes: This method requires either apache_get_modules or phpinfo()
|
||||||
|
* to be available.
|
||||||
|
*
|
||||||
* @param string $name module name
|
* @param string $name module name
|
||||||
* @return boolean true if exists
|
* @return boolean true if exists
|
||||||
* @since 1.4.5.0
|
* @since 1.4.5.0
|
||||||
@@ -2036,17 +2039,20 @@ FileETag INode MTime Size
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If apache_get_modules does not exists,
|
if (function_exists('phpinfo'))
|
||||||
// one solution should be parsing httpd.conf,
|
{
|
||||||
// but we could simple parse phpinfo(INFO_MODULES) return string
|
// If apache_get_modules does not exists,
|
||||||
ob_start();
|
// we parse phpinfo(INFO_MODULES) return string
|
||||||
phpinfo(INFO_MODULES);
|
ob_start();
|
||||||
$phpinfo = ob_get_contents();
|
phpinfo(INFO_MODULES);
|
||||||
ob_end_clean();
|
$phpinfo = ob_get_contents();
|
||||||
if (strpos($phpinfo, $name) !== false)
|
ob_end_clean();
|
||||||
return true;
|
if (strpos($phpinfo, $name) !== false)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// otherwise, use the default behavior
|
||||||
|
// see return value at the end of the function
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user