Mercurial > SimpleWebPresenter
comparison inputParser.inc @ 32:7b19be62ea94
Remove yet another global, replace by CacheTimeCheck class.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Thu, 04 Oct 2012 19:46:11 +0200 |
| parents | 394b5df43d1a |
| children | 511b6514823f |
comparison
equal
deleted
inserted
replaced
| 30:647b72603b7d | 32:7b19be62ea94 |
|---|---|
| 41 | 41 |
| 42 $confFile = "${lang}/${conf}.xml"; | 42 $confFile = "${lang}/${conf}.xml"; |
| 43 if (!file_exists($confFile)) { | 43 if (!file_exists($confFile)) { |
| 44 errorPage("Resource not available"); | 44 errorPage("Resource not available"); |
| 45 } | 45 } |
| 46 cache_time($confFile); | 46 $options->getCache()->cache_time($confFile); |
| 47 $doc = new DOMDocument(); | 47 $doc = new DOMDocument(); |
| 48 $doc->load($confFile); | 48 $doc->load($confFile); |
| 49 | 49 |
| 50 $toplevel = $doc->getElementsByTagName("toplevel"); | 50 $toplevel = $doc->getElementsByTagName("toplevel"); |
| 51 | 51 |
| 63 foreach ($includes as $include) { | 63 foreach ($includes as $include) { |
| 64 $src = $include->getAttribute("src"); | 64 $src = $include->getAttribute("src"); |
| 65 $subdoc = new DOMDocument(); | 65 $subdoc = new DOMDocument(); |
| 66 $subfile = "${lang}/${src}"; | 66 $subfile = "${lang}/${src}"; |
| 67 $subdoc->load("$subfile"); | 67 $subdoc->load("$subfile"); |
| 68 cache_time($subfile); | 68 $options->getCache()->cache_time($subfile); |
| 69 $parent = $include->parentNode; | 69 $parent = $include->parentNode; |
| 70 $xml = getElementByTagName($subdoc,"xml"); | 70 $xml = getElementByTagName($subdoc,"xml"); |
| 71 foreach($xml->childNodes as $child) { | 71 foreach($xml->childNodes as $child) { |
| 72 $text = $subdoc->saveXml($child); | 72 $text = $subdoc->saveXml($child); |
| 73 $clonedChild = $doc->importNode($child,true); | 73 $clonedChild = $doc->importNode($child,true); |
| 140 chdir("${cwd}"); | 140 chdir("${cwd}"); |
| 141 } | 141 } |
| 142 else { | 142 else { |
| 143 $src = $file->getAttribute("src"); | 143 $src = $file->getAttribute("src"); |
| 144 $fname = "${lang}/${src}"; | 144 $fname = "${lang}/${src}"; |
| 145 cache_time($fname); | 145 $options->getCache()->cache_time($fname); |
| 146 $file_content = loadFile($fname); | 146 $file_content = loadFile($fname); |
| 147 } | 147 } |
| 148 if(floatval($file_content)<0) { | 148 if(floatval($file_content)<0) { |
| 149 errorPage("Resource not found '${lang}/${src}'"); | 149 errorPage("Resource not found '${lang}/${src}'"); |
| 150 } | 150 } |
