$cacheRev) { $cache->clear(); @file_put_contents($cacheRevFile, $revision); } if ($cache->begin()) { $tool = new DocTool('docs/en.txt'); // $tool->setOption('clean-url', true); $baseUrl = ''; $title = 'Doctrine Manual'; $section = null; if (isset($_GET['chapter'])) { $section = $tool->findByPath($_GET['chapter']); if ($tool->getOption('clean-url')) { $baseUrl = '../'; } } if (isset($_GET['one-page'])) { $tool->setOption('one-page', true); $tool->setOption('max-level', 0); $section = null; $baseUrl = ''; } if ($section) { while ($section->getLevel() > 1) { $section = $section->getParent(); } $tool->setOption('section', $section); $title .= ' - Chapter ' . $section->getIndex() . ' ' . $section->getName(); } if ($tool->getOption('clean-url')) { $tool->setOption('base-url', $baseUrl); } include 'template.php'; $cache->end(); }