This repository has been archived by the owner on Jan 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
/
index.php
98 lines (75 loc) · 2.25 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
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
93
94
95
96
97
98
<?php
// used for direct access protection
define('KIRBY', true);
/*
---------------------------------------
Panel folder name
---------------------------------------
Will be autodetected. Only change if you
know what you are doing
*/
$folder = basename(dirname(__FILE__));
/*
---------------------------------------
Document root of your kirby installation
---------------------------------------
By default the panel must be installed in a
subfolder of your kirby site. Otherwise it
won't be able to load all the required files.
You can change that here but you must
also change all the other roots to lead to
the right folders. Don't change it if you
are not sure about it.
*/
$root = dirname(dirname(__FILE__));
/*
---------------------------------------
Kirby system folder
---------------------------------------
Link to the kirby system folder.
The panel loads a bunch of system files
from there, so this must be correct.
*/
$rootKirby = $root . '/kirby';
/*
---------------------------------------
Site folder
---------------------------------------
If you moved or reanamed your site folder
you must change it here as well.
Blueprints, config and accounts will be loaded
from there.
*/
$rootSite = $root . '/site';
$rootContent = $root . '/content';
$rootPanel = $root . '/' . $folder;
// include kirby
require_once($rootKirby . '/lib/kirby.php');
require_once($rootPanel . '/lib/load.php');
// set the root
c::set('root', $root);
c::set('root.kirby', $rootKirby);
c::set('root.site', $rootSite);
c::set('root.content', $rootContent);
c::set('root.panel', $rootPanel);
// panel version
c::set('panel.version.string', '0.9.2');
c::set('panel.version.number', 0.92);
c::set('panel.min.kirby.version', 1.11);
c::set('panel.folder', $folder);
paneload::lib();
paneload::config();
paneload::parsers();
// switch on errors
if(c::get('debug')) {
error_reporting(E_ALL);
ini_set('display_errors', 1);
} else {
error_reporting(0);
ini_set('display_errors', 0);
}
// set the timezone to make sure we
// avoid errors in php 5.3
@date_default_timezone_set(c::get('timezone'));
$site = new panel();
$site->load();