Rev 172 Rev 185
Line 1... Line 1...
1 <?php 1 <?php
2   2  
3 if (version_compare(phpversion(), '5.0.0', 'lt')) { 3 if (version_compare(phpversion(), '5.0.0', 'lt')) {
4   4  
5 # XXX: these includes shouldn't be necessary! -  
6 require_once 'include/configclass.inc'; -  
7 $config = new Config; -  
8 require_once 'include/config.inc'; -  
9 require_once($config->getPHPCompatFile()); -  
10   -  
11 // Configure necessary functions here 5 // Configure necessary functions here
12 $funcs = array( 6 $funcs = array(
13 'stripos', 7 'stripos',
14 'http_build_query', 8 'http_build_query',
15 ); 9 );
16   10  
17 // End configuration 11 // End configuration
18   12  
-   13 // JB: PHP_Compat expects to be able to find functions by including
-   14 // 'PHP/Compat/Functions/functionname.php', but that hardcoded path
-   15 // isn't relative to the standard include path '.' (it's instead relative
-   16 // to './include'). So rather than hack PHP_Compat to work, just add
-   17 // './include' to our include path.
-   18 ini_set("include_path", ini_get("include_path").$config->pathSeparator."./include");
-   19  
19 foreach ($funcs as $fn) { 20 foreach ($funcs as $fn) {
20 if (PHP_Compat::loadFunction($fn) != true) 21 if (PHP_Compat::loadFunction($fn) != true)
21 error_log('Could not load function `'.$fn.'\' as required by PHP Compat.'); 22 error_log('Could not load function `'.$fn.'\' as required by PHP Compat.');
22 } 23 }
23   24