-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathindex.php
39 lines (29 loc) · 922 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/*
* Edith's dispatching controller.
*
* RESTfully answers to GET, HEAD, POST, PUT and DELETE to these resources:
* /{pagename}
* /{pagename}.{representation}
*/
@include 'config.php';
require 'lib/helpers.php';
require 'lib/page.class.php';
require_once 'lib/Michelf/MarkdownExtra.inc.php';
define('EDITH_REPRESENTATIONS', array('html', 'txt', 'remark', 'graphviz'));
if (!defined('EDITH_URI'))
define('EDITH_URI', '');
if (!defined('EDITH_DATA_PATH'))
define('EDITH_DATA_PATH', 'data');
if (!defined('EDITH_DATA_EXTENSION'))
define('EDITH_DATA_EXTENSION', '.txt');
if (!defined('EDITH_UNWRITEABLE_PAGES'))
define('EDITH_UNWRITEABLE_PAGES', array());
if (!defined('URI_REGEX'))
define(
'URI_REGEX',
'#^/?([^/]+?)\.?('.implode('|', EDITH_REPRESENTATIONS).')?$#'
);
if (file_exists(preg_replace('#^\/#', '', $_SERVER["REQUEST_URI"])))
return false;
require 'lib/routes.php';