-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
59 lines (52 loc) · 1.71 KB
/
Copy pathindex.php
File metadata and controls
59 lines (52 loc) · 1.71 KB
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
58
59
<?php
if (!defined("DS"))
{
define("DS", DIRECTORY_SEPARATOR);
}
// The root of the public directory.
if (!defined("ROOT"))
{
define("ROOT", dirname(__FILE__));
}
// The include path will be the directory '/Lib' classes should be put here.
set_include_path(implode(PATH_SEPARATOR, array(get_include_path(),
ROOT . DS . "src" . DS . "Lib")));
require "BensonPHP/Exceptions.php";
require "BensonPHP/Config.php";
require "BensonPHP/HtmlHelper.php";
require "BensonPHP/Form.php";
require "BensonPHP/Request.php";
require "BensonPHP/AbstractController.php";
require "BensonPHP/Controller.php";
require "BensonPHP/View.php";
require "BensonPHP/AbstractModel.php";
require "BensonPHP/DataAccess.php";
require "BensonPHP/Database.php";
require "BensonPHP/Session.php";
require "BensonPHP/Util.php";
require "BensonPHP/Access.php";
require "BensonPHP/Image.php";
// The development environment allows different settings in the config file to
// be applied. WARNING: Make sure this commented out in production.
Config::enableDevelopmentEnvironment();
Config::load();
if (Config::navigateTo("Site.ShowExceptions")->toString() === "true") {
error_reporting(E_ALL);
} else {
// Turn off error_reporting
error_reporting(0);
}
Request::loadRoutes();
date_default_timezone_set(Config::navigateTo("Site.Timezone")->getAttribute("name"));
/**
* Auto load the classes in the Models directory
*/
function __autoload($class) {
$path = ROOT . DS . "src" . DS . "Models" . DS . $class . Config::getOption("Extension", "BensonPHP");
if (file_exists($path)) {
include_once($path);
return;
}
}
$controller = new Controller(Request::getRequestArgs());
$controller->dispatch();