Permalink
Browse files

Candidate fix for issue outlined here:

  • Loading branch information...
BraveSirRobin committed Jan 28, 2012
1 parent d331222 commit 2b12b571010bc16e4d9e36802da43e688f63e1e3
Showing with 13 additions and 0 deletions.
  1. +13 −0 phing/AmqpCodeGenTask.php
View
@@ -45,6 +45,14 @@ function main () {
}
$proc = new XsltProcessor;
+ /** For PHP versions > 5.3.8, ensure that the XSLT processor
+ * is able to write files, otherwise the build will fail. */
+ if (version_compare(PHP_VERSION,'5.4',"<")) {
+ $oldval = ini_set("xsl.security_prefs",XSL_SECPREFS_NONE);
+ } else {
+ $oldval = $proc->setSecurityPreferences(XSL_SECPREFS_NONE);
+ }
+
$ssDom = new DomDocument;
if (! $ssDom->load($this->stylesheet)) {
throw new \Exception("codegen task failed to load stylesheet dom", 8475);
@@ -58,6 +66,11 @@ function main () {
$proc->setParameter('', 'OUTPUT_DIR', $this->outputDir);
$proc->transformToXml($specDom);
+ if (version_compare(PHP_VERSION,'5.4',"<")) {
+ ini_set("xsl.security_prefs",$oldval);
+ } else {
+ $proc = null;
+ }
}

0 comments on commit 2b12b57

Please sign in to comment.