forked from sunny/edith
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
38 lines (28 loc) · 906 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
<?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 'lib/markdown_extended.php';
$REPRESENTATIONS = array('html', 'txt', 'remark');
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('URI_REGEX'))
define('URI_REGEX', '#^/?([^/]+?)\.?('.implode('|', $REPRESENTATIONS).')?$#');
if (!defined('MOBWRITE_KEY'))
define('MOBWRITE_KEY', 'edith');
if (!defined('MOBWRITE_URI'))
define('MOBWRITE_URI', null);
if (file_exists(preg_replace('#^\/#', '', $_SERVER["REQUEST_URI"])))
return false;
require 'lib/routes.php';