This repository has been archived by the owner on Sep 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboot.php
116 lines (89 loc) · 2.4 KB
/
boot.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/*
* PHP Road application bootstrap script
*/
error_reporting( E_ALL );
ini_set( 'display_errors', true );
/*
* This variable contains a path to this file.
*/
$bootstrapPath = __FILE__;
/*
* Specify the application directory root
*
* Leave this variable blank if application root directory matches the site root directory.
* Otherwise specify an absolute path to the application root, for example:
* $applicationRoot = realpath( dirname($bootstrapPath)."/../app" );
*
*/
$applicationRoot = "";
/*
* Define a path to the Control Center and use this path in the Control Center address.
* For example, if you specify the "secretgate", use the http://www.your_cool_domain.com/secretgate.
*/
include 'config/config.php';
/*
* Detect resource request
*/
if (array_key_exists('q', $_GET) && (strpos($_GET['q'], 'ls_javascript_combine/') !== false || strpos($_GET['q'], 'ls_css_combine/') !== false))
{
include( "phproad/system/combine_resources.php" );
die();
}
/*
* Detect CLI
*/
function ls_detect_command_line_interface()
{
$sapi = php_sapi_name();
if ($sapi == 'cli')
return true;
// if (array_key_exists('SHELL', $_SERVER) && strlen($_SERVER['SHELL']))
// return true;
if (!array_key_exists('DOCUMENT_ROOT', $_SERVER) || !strlen($_SERVER['DOCUMENT_ROOT']))
return true;
return false;
}
/*
* Detect the CLI update argument
*/
$ls_cli_update_flag = false;
$ls_cli_force_update = false;
$ls_cli_mode = ls_detect_command_line_interface();
if ($ls_cli_mode)
{
if (isset($_SERVER["argv"]))
{
foreach ($_SERVER["argv"] as $argument)
{
if ($argument == '--update')
$ls_cli_update_flag = true;
if ($argument == '--force')
$ls_cli_force_update = true;
}
}
}
if ($ls_cli_mode)
{
global $Phpr_NoSession;
global $Phpr_InitOnly;
$Phpr_NoSession = true;
$Phpr_InitOnly = true;
$APP_CONF = array();
$APP_CONF['ERROR_LOG_FILE'] = dirname(__FILE__).'/logs/cli_errors.txt';
$APP_CONF['NO_TRACELOG_CHECK'] = true;
}
/*
* Include the PHP Road library
*
* You may need to specify a full path to the phproad.php script,
* in case if the PHP Road root directory is not specified in the PHP includes path.
*
*/
include( "phproad/system/phproad.php" );
if ($ls_cli_update_flag)
{
Core_Cli::authenticate();
Core_UpdateManager::create()->cli_update($ls_cli_force_update);
}
?>