-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.php
31 lines (25 loc) · 1.01 KB
/
dev.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
<?php
// Development server. Contains certain routes that
// the production server doesn't need, as they're configured in Apache.
require_once __DIR__ . "/config.php";
require_once __DIR__ . "/core.php";
require_once __DIR__ . "/router.php";
switch(true) {
case is_file(__DIR__ . $path) and is_builtin():
# Serve file as-is. Only applies to the development server,
# in production this will be handled by Apache directly.
return false;
# Serve RSS feeds. Again, only in development.
case route('@/rss.xml$@'): include __DIR__ . "/feeds/rss.php"; exit;
case route('@/atom.xml$@'): include __DIR__ . "/feeds/atom.php"; exit;
case route('@/feed.json$@'): include __DIR__ . "/feeds/json.php"; exit;
case route('@/endpoint/(\w+)$@'):
// Here be dragons.
// But it's development, so who cares. Nobody is gonna
// run the dev server in prod anyway. Right... right???!
include __DIR__ . "/endpoint/" . $params[1] . ".php";
exit;
default:
include __DIR__ . "/index.php";
exit;
}