/WebSVN/include/php5compat.inc
2,12 → 2,6
 
if (version_compare(phpversion(), '5.0.0', 'lt')) {
 
# XXX: these includes shouldn't be necessary!
require_once 'include/configclass.inc';
$config = new Config;
require_once 'include/config.inc';
require_once($config->getPHPCompatFile());
 
// Configure necessary functions here
$funcs = array(
'stripos',
16,6 → 10,13
 
// End configuration
 
// JB: PHP_Compat expects to be able to find functions by including
// 'PHP/Compat/Functions/functionname.php', but that hardcoded path
// isn't relative to the standard include path '.' (it's instead relative
// to './include'). So rather than hack PHP_Compat to work, just add
// './include' to our include path.
ini_set("include_path", ini_get("include_path").$config->pathSeparator."./include");
 
foreach ($funcs as $fn) {
if (PHP_Compat::loadFunction($fn) != true)
error_log('Could not load function `'.$fn.'\' as required by PHP Compat.');