Terminate files with a NL to appease sensiolabs
[plcapi.git] / doc / convert.php
index a811c4e..a7e08cb 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Script used to convert docbook source to human readable docs.
  *
- * @copyright (c) 2007-2014 G. Giunta
+ * @copyright (c) 2007-2015 G. Giunta
  */
 if ($_SERVER['argc'] < 4) {
     die("Usage: php convert.php docbook.xml \path\\to\stylesheet.xsl output-dir|output_file\n");
@@ -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