forked from oxwall/install
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.php
More file actions
78 lines (59 loc) · 2.23 KB
/
install.php
File metadata and controls
78 lines (59 loc) · 2.23 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
$installComplete = false;
$dbReady = false;
if ( defined('OW_URL_HOME') )
{
try
{
$installedValue = (bool) OW::getConfig()->getValue('base', 'site_installed');
$installComplete = (bool) OW::getConfig()->getValue('base', 'install_complete');
}
catch ( Exception $e )
{
$installedValue = false;
$installComplete = false;
}
$dbReady = $installedValue;
}
if ( !$installComplete || ( defined('OW_INSTALL_DEV') && OW_INSTALL_DEV ) )
{
if ( !defined('OW_URL_HOME') )
{
$selfUrl = UTIL_Url::selfUrl();
if ( substr($selfUrl, -1) != '/' )
{
$selfUrl .= '/';
}
$installPos = strpos($selfUrl, '/install');
if ( !$installPos )
{
$installPos = strpos($selfUrl, '/ow_install');
}
if ( $installPos )
{
$selfUrl = substr($selfUrl, 0, $installPos) . '/';
}
define('OW_URL_HOME', $selfUrl);
}
define('INSTALL_DIR_ROOT', dirname(__FILE__) . DS);
define('INSTALL_URL_ROOT', OW_URL_HOME . 'ow_install/');
define('INSTALL_URL_VIEW', INSTALL_URL_ROOT . 'view/');
define('INSTALL_DIR_CLASSES', INSTALL_DIR_ROOT . 'classes' . DS);
define('INSTALL_DIR_BOL', INSTALL_DIR_ROOT . 'bol' . DS);
define('INSTALL_DIR_CTRL', INSTALL_DIR_ROOT . 'controllers' . DS);
define('INSTALL_DIR_CMP', INSTALL_DIR_ROOT . 'components' . DS);
define('INSTALL_DIR_VIEW', INSTALL_DIR_ROOT . 'view' . DS);
define('INSTALL_DIR_VIEW_CTRL', INSTALL_DIR_VIEW . 'controllers' . DS);
define('INSTALL_DIR_VIEW_CMP', INSTALL_DIR_VIEW . 'components' . DS);
define('INSTALL_DIR_FILES', INSTALL_DIR_ROOT . 'files' . DS);
OW::getAutoloader()->addPackagePointer('INSTALL', INSTALL_DIR_CLASSES);
OW::getAutoloader()->addPackagePointer('INSTALL_BOL', INSTALL_DIR_BOL);
OW::getAutoloader()->addPackagePointer('INSTALL_CTRL', INSTALL_DIR_CTRL);
OW::getAutoloader()->addPackagePointer('INSTALL_CMP', INSTALL_DIR_CMP);
OW::getAutoloader()->addClass('INSTALL', INSTALL_DIR_CLASSES . 'install.php');
OW::getSession()->start();
$application = INSTALL_Application::getInstance();
$application->init($dbReady);
$application->display($dbReady);
exit;
}