Merge branch '3.1/develop' into 3.2/develop
[kohana-userguide.git] / init.php
blob180a935fbdf30f42e117ffba8ef3a70c2f9e4dcc
1 <?php defined('SYSPATH') or die('No direct script access.');
3 // Static file serving (CSS, JS, images)
4 Route::set('docs/media', 'guide/media(/<file>)', array('file' => '.+'))
5 ->defaults(array(
6 'controller' => 'userguide',
7 'action' => 'media',
8 'file' => NULL,
9 ));
11 // API Browser, if enabled
12 if (Kohana::$config->load('userguide.api_browser') === TRUE)
14 Route::set('docs/api', 'guide/api(/<class>)', array('class' => '[a-zA-Z0-9_]+'))
15 ->defaults(array(
16 'controller' => 'userguide',
17 'action' => 'api',
18 'class' => NULL,
19 ));
22 // User guide pages, in modules
23 Route::set('docs/guide', 'guide(/<module>(/<page>))', array(
24 'page' => '.+',
26 ->defaults(array(
27 'controller' => 'userguide',
28 'action' => 'docs',
29 'module' => '',
30 ));
32 // Simple autoloader used to encourage PHPUnit to behave itself.
33 class Markdown_Autoloader {
34 public static function autoload($class)
36 if ($class == 'Markdown_Parser' OR $class == 'MarkdownExtra_Parser')
38 include_once Kohana::find_file('vendor', 'markdown/markdown');
43 // Register the autoloader
44 spl_autoload_register(array('Markdown_Autoloader', 'autoload'));