forked from jamalsa/minium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
57 lines (51 loc) · 2.1 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* This is the path to the class libraries used by your application, and must contain a copy of the
* Lithium core. By default, this directory is named `libraries`, and resides in the same
* directory as your application. If you use the same libraries in multiple applications, you can
* set this to a shared path on your server.
*/
define('LITHIUM_LIBRARY_PATH', __DIR__ . '/libraries');
/**
* Locate and load Lithium core library files. Throws a fatal error if the core can't be found.
* If your Lithium core directory is named something other than 'lithium', change the string below.
*/
if (!include LITHIUM_LIBRARY_PATH . '/lithium/core/Libraries.php') {
$message = "Lithium core could not be found. Check the value of LITHIUM_LIBRARY_PATH in ";
$message .= __FILE__ . ". It should point to the directory containing your ";
$message .= "/libraries directory.";
throw new ErrorException($message);
}
/**
* Add Lithium core lib
*/
lithium\core\Libraries::add('lithium');
/**
* Include routes
*/
include 'routes.php';
/**
* Include filters
*/
include 'filters.php';
/**
* Run It!
*
* The following will instantiate a new `Request` object and pass it off to the `Dispatcher` class.
* By default, the `Request` will automatically aggregate all the server / environment settings, URL
* and query string parameters, request content (i.e. POST or PUT data), and HTTP method and header
* information.
*
* The `Request` is then used by the `Dispatcher` (in conjunction with the `Router`) to determine
* the correct `Controller` object to dispatch to, and the correct response type to render. The
* response information is then encapsulated in a `Response` object, which is returned from the
* controller to the `Dispatcher`, and finally echoed below. Echoing a `Response` object causes its
* headers to be written, and its response body to be written in a buffer loop.
*
* @see lithium\action\Request
* @see lithium\action\Response
* @see lithium\action\Dispatcher
* @see lithium\net\http\Router
* @see lithium\action\Controller
*/
echo lithium\action\Dispatcher::run(new lithium\action\Request());