/** * Implements Actioner. */ public function execute($args = NULL) { $fc =& FrontController::fc(); $fc->outputHeader($this->title(), 'masterserver'); $fc->beginPage($this->title(), 'masterserver'); ?> <div id="contentbox"><div class="masterbrowser block"><?php // Output a "join us" foreword. includeHTML('joinus', self::$name); try { FrontController::contentCache()->import(self::$serverSummaryCacheName); $this->outputJavascript(); } catch (Exception $e) { ?> <p>A master server listing is not presently available. Please try again later.</p><?php } // Output footnotes. includeHTML('footnotes', self::$name); ?> </div><?php ?> <div class="block"><section><p>A server admin is not required to publish their server to this central list (located at <em>http://dengine.net/master.php</em>), however it will then only be findable by clients who enter the IP address manually. A server may be published here but remain "closed" (requiring a password to join). Further information about the master server is available <a href="/dew/index.php?title=Master_server" title="Documentation for the master server">here</a>.</p></section></div><?php ?> </div><?php $fc->endPage(); }
/** * Implements Actioner. */ public function execute($args = NULL) { $fc =& FrontController::fc(); if (!is_array($args) && !array_key_exists('page', $args)) { throw new Exception('Unexpected arguments passed.'); } $page = $args['page']; $mainHeading = ucwords(mb_ereg_replace('_', ' ', $page)); $pageFile = 'pages/' . $args['page'] . '.html'; $fc->outputHeader($mainHeading); $fc->beginPage($mainHeading, $page); ?> <div id="contentbox"><?php try { FrontController::contentCache()->import($pageFile); } catch (Exception $e) { ?> <p>No content for this page</p> <?php } ?> </div><?php $fc->endPage(); }
private function outputPackageGraph(&$pack) { $fc =& FrontController::fc(); if (!$pack instanceof BasePackage) { throw new Exception('Received invalid Package.'); } $cacheName = $this->composePackageGraphCacheName($pack); try { if (!FrontController::contentCache()->has($cacheName)) { // Generate a graph template for this package. $template = array(); $pack->populateGraphTemplate($template); $json = json_encode_clean($template); // Store the graph in the cache. FrontController::contentCache()->store($cacheName, $json); } $contentInfo = new ContentInfo(); if (FrontController::contentCache()->info($cacheName, $contentInfo)) { header('Pragma: public'); header('Cache-Control: public'); header('Content-Type: application/json'); header('Last-Modified: ' . date(DATE_RFC1123, $contentInfo->modifiedTime)); header('Expires: ' . date(DATE_RFC1123, strtotime('+5 days'))); FrontController::contentCache()->import($cacheName); } } catch (Exception $e) { // Log the error. trigger_error(sprintf('Failed reading Package JSON from cache.\\nError:%s', $e->getMessage()), E_USER_WARNING); } return TRUE; }
/** * @param build (object) BuildEvent to generate a commit log for. * @return (boolean) @c true if a commit log was sent to output. */ function outputCommitLog(&$build) { if (!$build instanceof BuildEvent) { throw new Exception('Received invalid BuildEvent'); } if (count($build->commits) <= 0) { return FALSE; } $commitsCacheName = 'buildrepository/' . $build->uniqueId() . '/commits.html'; try { FrontController::contentCache()->import($commitsCacheName); } catch (Exception $e) { $OutputCache = new OutputCache(); $OutputCache->start(); outputCommitLogHTML($build); $content = $OutputCache->stop(); FrontController::contentCache()->store($commitsCacheName, $content); print $content; } return TRUE; }