/** * This cachers the requested page. */ public function Cacher($page) { //Include the pager include_once "core/view/Page.php"; //The Title of the website $siteTitle = $this->openFile("data/config/site_title.dat"); //Create the pager $pager = new Pager($siteTitle); //Get the page content $data = $this->getPageData($page); //Set the page title $pager->setContentTitle($data[0]); //If Not on default template set the alternate one if ($data[1] != "Default") { $pager->setTemplate($data[1]); } //Set the page content $pager->setContent($data[3]); //Page not published. Cache 404 page. if ($data[2] == "true") { $pager->noPage(); } //Generate the page $toCache = $pager->softDisplayPage(); //Save to the cache $this->saveFile("cache/" . $page . ".html", $toCache); }