diff --git a/manual/new/lib/Cache.php b/manual/new/lib/Cache.php deleted file mode 100644 index 8810fa714..000000000 --- a/manual/new/lib/Cache.php +++ /dev/null @@ -1,81 +0,0 @@ -_dir = $dir; - $this->_ext = $ext; - - $this->_page = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; - $this->_file = $this->_dir . md5($this->_page) . '.' . $this->_ext; - } - - /** - * Begins caching the output. - * - * @return A boolean value indicating whether a valid cached version of the - * page was found and echoed (false), or not (true). - */ - public function begin() - { - $showCache = (file_exists($this->_file) && $this->isValid()); - clearstatcache(); - - if ($showCache) { - readfile($this->_file); - return false; - } else { - ob_start(); - return true; - } - } - - /** - * Ends caching the output and saves it to a cache file. - * - */ - public function end() - { - // Generate a new cache file - $fp = @fopen($this->_file, 'w'); - - // Save the contents of output buffer to the file - @fwrite($fp, ob_get_contents()); - @fclose($fp); - - ob_end_flush(); - } - - /** - * Deletes all files in the cache directory. - */ - public function clear() - { - if ($handle = @opendir($this->_dir)) { - while ($file = readdir($handle)) { - if ($file !== '.' && $file !== '..') { - @unlink($this->_dir . '/' . $file); - } - } - closedir($handle); - } - } - - /** - * This method is used to check whether the cache file is valid to use. - * - * Currently it assumes that the cache file is always valid. - * - * @return True, if cache file is valid; false otherwise. - */ - protected function isValid() - { - return true; - } -} \ No newline at end of file diff --git a/manual/new/lib/DocTool.php b/manual/new/lib/DocTool.php deleted file mode 100644 index 6436782cc..000000000 --- a/manual/new/lib/DocTool.php +++ /dev/null @@ -1,231 +0,0 @@ - 1, - 'one-page' => false, - 'section' => null, - 'clean-url' => false, - 'base-url' => ''); - private $_lang = array(); - - public function __construct($filename) - { - $this->_toc = new Sensei_Doc_Toc($filename); - - $this->_wiki = Text_Wiki::singleton('Doc'); - $this->_wiki->setParseConf('Doclink', 'toc', $this->_toc); - $this->_wiki->setRenderConf('xhtml', 'Doclink', 'url_callback', array(&$this, 'makeUrl')); - } - - public function getOption($option) - { - return $this->_options[$option]; - } - - public function setOption($option, $value) - { - switch ($option) { - case 'max-level': - $value = (int) $value; - break; - - case 'one-page': - case 'clean-url': - $value = (bool) $value; - break; - - case 'base-url': - $value = (string) $value; - break; - - case 'section': - if (! $value instanceof Sensei_Doc_Section) { - throw new Exception('Value must be an instance of Sensei_Doc_Section.'); - } - break; - - default: - throw new Exception('Unknown option.'); - } - - $this->_wiki->setRenderConf('xhtml', 'Doclink', 'view_url', $this->getUrlPrefix()); - - $this->_options[$option] = $value; - } - - public function renderToc($toc = null) - { - if (!$toc) { - $toc = $this->_toc; - } - - $classes = array(); - - if ($toc instanceof Sensei_Doc_Toc) { - - $class = ''; - if ($this->getOption('one-page')) { - $class = ' class="one-page"'; - } - - $classes[] = 'tree'; - - } else { - - $isParent = false; - $section = $this->getOption('section'); - - if ($section !== null) { - $current = $section; - do { - if ($current === $toc) { - $isParent = true; - break; - } - } while (($current = $current->getParent()) !== null); - } - - if (! $isParent) { - $classes[] = 'closed'; - } - } - - $classes = implode(' ', $classes); - - if ($classes === '') { - echo "