-
-
Notifications
You must be signed in to change notification settings - Fork 210
/
Copy pathbundle.php
75 lines (62 loc) · 2.54 KB
/
bundle.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
<?php
/**
* @package boot
*/
// Set appropriate error reporting:
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT);
// Turn off old-style magic:
ini_set('magic_quotes_runtime', false);
// Redirect to installer if it exists
if (!file_exists(CONFIG)) {
$bInsideInstaller = (bool)preg_match('%(/|\\\\)install(/|\\\\)index.php$%', server_safe('SCRIPT_FILENAME'));
if (!$bInsideInstaller && Symphony::isInstallerAvailable()) {
header(sprintf('Location: %s/install/', URL));
exit;
} elseif (!$bInsideInstaller) {
die('<h2>Error</h2><p>Could not locate Symphony configuration file. Please check <code>manifest/config.php</code> exists.</p>');
}
} else {
// Load configuration file:
include CONFIG;
Symphony::initialiseConfiguration($settings);
Symphony::initialiseErrorHandler();
Symphony::initialiseDatabase();
Symphony::initialiseExtensionManager();
// Report all errors
if (Symphony::Configuration()->get('error_reporting_all', 'symphony') === 'yes') {
error_reporting(E_ALL);
}
// Handle custom admin paths, #702
$adminPath = Symphony::Configuration()->get('admin-path', 'symphony');
$adminPath = (is_null($adminPath)) ? 'symphony' : $adminPath;
// getCurrentPage() always starts with / #2522
$adminRegExp = '%^\/' . preg_quote($adminPath) . '\/%';
if (preg_match($adminRegExp, getCurrentPage()) === 1) {
$_GET['symphony-page'] = preg_replace($adminRegExp, '', getCurrentPage(), 1);
if ($_GET['symphony-page'] == '') {
unset($_GET['symphony-page']);
}
$_GET['mode'] = $_REQUEST['mode'] = 'administration';
}
/**
* Returns the URL + /symphony. This should be used whenever the a developer
* wants to link to the Symphony root
* @since Symphony 2.2
* @var string
*/
define_safe('SYMPHONY_URL', URL . '/' . $adminPath);
/**
* Overload the default Symphony launcher logic.
* @delegate ModifySymphonyLauncher
* @since Symphony 2.5.0
* @param string $context
* '/all/'
*/
Symphony::ExtensionManager()->notifyMembers(
'ModifySymphonyLauncher', '/all/'
);
// Use default launcher:
if (defined('SYMPHONY_LAUNCHER') === false) {
define('SYMPHONY_LAUNCHER', 'symphony_launcher');
}
}