From 64474c14afdb45961cd232d30cc443f0c318f292 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Tue, 01 Mar 2011 00:55:41 +0000 Subject: Sugar Labs website 2010 --- (limited to 'index-old.php') diff --git a/index-old.php b/index-old.php new file mode 100755 index 0000000..c20c7ee --- /dev/null +++ b/index-old.php @@ -0,0 +1,43 @@ + $_GET['page'], + 'article' => $_GET['article'], + 'language' => $_GET['language'] + ); + $page = $_GET['page']; + $article = $_GET['article']; + $language = $_GET['language']; + $cached_name = "cache/$xslfilename$page$article$language.xml"; + + // does a cached version exist? + if (file_exists($cached_name)) { + readfile($cached_name); + } else { + // load the xml file and stylesheet as domdocuments + $xsl = new DomDocument(); + $xsl->load("xsl/$xslfilename.xsl"); + + $xml = new DomDocument(); + $xml->load("xml/index.xml"); + $xml->Xinclude(); + + // create the processor and import the stylesheet + $proc = new XsltProcessor(); + $xsl = $proc->importStylesheet($xsl); + $proc->setParameter(null, $arguments); + + // transform and output the xml document, caching result + $output = $proc->transformToDoc($xml)->saveXML(); + + // enable this line on server to enable caching + file_put_contents($cached_name, $output); + print $output; + } +?> \ No newline at end of file -- cgit v0.9.1