-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
45 lines (37 loc) · 1.22 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
<?php
/**
*
* This bootstrap file is intended only for first-time users who have dumped
* the system directly into their document root. We make some special
* allowances for that in this file, even though it is **not secure at all**.
*
* When you're ready to really get going, point your web server document root
* to `system/docroot/` and turn on mod_rewrite.
*
*/
// Solar system directory
$system = dirname(__FILE__);
// set the include-path
set_include_path("$system/include");
// load Solar
require_once 'Solar.php';
// get the system config array
$config = require "$system/config.php";
// force the Action and Public URI path configs, overwriting anything from
// the original config
$path = $_SERVER['REQUEST_URI'];
$pos = strpos($path, "/index.php");
if ($pos !== false) {
// strip "/index.php" and everything after it
$path = substr($path, 0, $pos);
}
$path = rtrim($path, '/');
$config['Solar_Uri_Action']['path'] = "$path/index.php";
$config['Solar_Uri_Public']['path'] = "$path/docroot/public";
// start Solar with the modified config values
Solar::start($config);
// instantiate and run the front controller
$front = Solar_Registry::get('controller_front');
$front->display();
// Done!
Solar::stop();