From 05ba4479e2f74f0a51797ca268b1b8751f544614 Mon Sep 17 00:00:00 2001 From: gggeek Date: Sat, 21 Feb 2015 18:58:18 +0000 Subject: [PATCH] Reformat source code: doc --- doc/convert.php | 47 ++++++++++++++++++++--------------------- doc/custom.fo.xsl | 2 +- doc/custom.xsl | 2 +- doc/highlight.php | 53 ++++++++++++++++++++++------------------------- 4 files changed, 50 insertions(+), 54 deletions(-) diff --git a/doc/convert.php b/doc/convert.php index 4de3b444..a811c4ed 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"; diff --git a/doc/custom.fo.xsl b/doc/custom.fo.xsl index f87d9747..54598264 100644 --- a/doc/custom.fo.xsl +++ b/doc/custom.fo.xsl @@ -1,7 +1,7 @@ + xmlns:fo="http://www.w3.org/1999/XSL/Format">