X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=doc%2Fconvert.php;h=a811c4edbb91b1281edf5abd00faebda2c265d66;hb=05ba4479e2f74f0a51797ca268b1b8751f544614;hp=4de3b444f3e679931f815eaba758b658e937e1e6;hpb=5b0b061574fa8458d5a92c24c20d077ad832cf63;p=plcapi.git diff --git a/doc/convert.php b/doc/convert.php index 4de3b44..a811c4e 100644 --- a/doc/convert.php +++ b/doc/convert.php @@ -1,57 +1,56 @@ load($doc); -$xsl = new DOMDocument; +$xsl = new DOMDocument(); $xsl->load($xss); // Configure the transformer -$proc = new XSLTProcessor; -if (version_compare(PHP_VERSION,'5.4',"<")) -{ - if(defined('XSL_SECPREF_WRITE_FILE')) +$proc = new XSLTProcessor(); +if (version_compare(PHP_VERSION, '5.4', "<")) { + if (defined('XSL_SECPREF_WRITE_FILE')) { ini_set("xsl.security_prefs", XSL_SECPREF_CREATE_DIRECTORY | XSL_SECPREF_WRITE_FILE); -} -else -{ + } +} else { $proc->setSecurityPreferences(XSL_SECPREF_CREATE_DIRECTORY | XSL_SECPREF_WRITE_FILE); } $proc->importStyleSheet($xsl); // attach the xsl rules //if ($_SERVER['argc'] >= 4) //{ - if (is_dir($_SERVER['argv'][3])) - { - if (!$proc->setParameter('', 'base.dir', realpath($_SERVER['argv'][3]))) - echo "setting param base.dir KO\n"; - } - else - { - //echo "{$_SERVER['argv'][3]} is not a dir\n"; +if (is_dir($_SERVER['argv'][3])) { + if (!$proc->setParameter('', 'base.dir', realpath($_SERVER['argv'][3]))) { + echo "setting param base.dir KO\n"; } +} else { + //echo "{$_SERVER['argv'][3]} is not a dir\n"; +} //} $out = $proc->transformToXML($xml); -if (!is_dir($_SERVER['argv'][3])) +if (!is_dir($_SERVER['argv'][3])) { file_put_contents($_SERVER['argv'][3], $out); +} echo "OK\n";