-
Notifications
You must be signed in to change notification settings - Fork 1
/
admin.php
92 lines (78 loc) · 2.65 KB
/
admin.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
/*
|--------------------------------------------------------------------------
| Statamic
|--------------------------------------------------------------------------
|
| Statamic is a flat-file, dynamic, and highly flexible publishing
| engine, built for developers, designers, and clients alike.
|
| @author Jack McDade ([email protected])
| @author Fred LeBlanc ([email protected])
| @copyright 2012 Statamic
|
*/
/*
|--------------------------------------------------------------------------
| Web Root
|--------------------------------------------------------------------------
|
| Lots of file level activities enjoy knowing right where web root is.
|
*/
define("BASE_PATH", str_replace('\\', '/', __DIR__));
// define site root
$doc_root = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
define("SITE_ROOT", str_replace($doc_root, '', BASE_PATH) . '/');
/*
|--------------------------------------------------------------------------
| Running Above Web Root
|--------------------------------------------------------------------------
|
| To run Statamic above webroot, uncomment the following line. Make sure
| to update the public folder setting in your site config.
|
*/
// chdir('..');
/*
|--------------------------------------------------------------------------
| Autoloader
|--------------------------------------------------------------------------
|
| "Autoload" the application dependencies and libraries
|
*/
require __DIR__ . '/_app/autoload.php';
/*
|--------------------------------------------------------------------------
| Load Configs
|--------------------------------------------------------------------------
|
| We need to load the configs here because we don't necessarily know
| the name of the admin folder.
|
*/
$config = Statamic::loadAllConfigs(true);
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Many users are upgrading to PHP 5.3 for the first time. I know.
| We've gone ahead set the default timezone that will be used by the PHP
| date and date-time functions. This prevents some potentially
| frustrating errors for novice developers.
|
*/
date_default_timezone_set(Helper::pick($config['_timezone'], @date_default_timezone_get(), "UTC"));
/*
|--------------------------------------------------------------------------
| Start the Engine
|--------------------------------------------------------------------------
|
| All the heavy initilization and configuration happens right here.
| Let's get going!
|
*/
$admin_app = require_once __DIR__ . '/' . $config['_admin_path'] . '/start.php';
$admin_app->run();