From: gggeek Date: Sat, 21 Feb 2015 21:48:13 +0000 (+0000) Subject: Make sure convert.php works with php5.6.1 on linux X-Git-Tag: 4.0.0-alpha^2~178 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=040d77ff5a5c9316b092bfccc9eea4b88673578b;p=plcapi.git Make sure convert.php works with php5.6.1 on linux --- diff --git a/doc/convert.php b/doc/convert.php index 9cfe0f3f..a7e08cbc 100644 --- a/doc/convert.php +++ b/doc/convert.php @@ -33,7 +33,12 @@ if (version_compare(PHP_VERSION, '5.4', "<")) { ini_set("xsl.security_prefs", XSL_SECPREF_CREATE_DIRECTORY | XSL_SECPREF_WRITE_FILE); } } else { - $proc->setSecurityPreferences(XSL_SECPREF_CREATE_DIRECTORY | XSL_SECPREF_WRITE_FILE); + // the php online docs only mention setSecurityPrefs, but somehow some installs have setSecurityPreferences... + if (method_exists('XSLTProcessor', 'setSecurityPrefs')) { + $proc->setSecurityPrefs(XSL_SECPREF_CREATE_DIRECTORY | XSL_SECPREF_WRITE_FILE); + } else { + $proc->setSecurityPreferences(XSL_SECPREF_CREATE_DIRECTORY | XSL_SECPREF_WRITE_FILE); + } } $proc->importStyleSheet($xsl); // attach the xsl rules