Skip to content

Commit fe7f44c

Browse files
committed
[FIX] Refactor installation.
1 parent 5ce5a69 commit fe7f44c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+264
-351
lines changed
Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,33 @@
11
<?php
2-
/*
3-
error_reporting(E_ALL & ~E_NOTICE);
2+
define('MGR', MODX_BASE_PATH . MGR_DIR);
43

5-
define('MODX_BASE_PATH',realpath('../../../../').'/');
6-
include_once(MODX_BASE_PATH."assets/cache/siteManager.php");*/
7-
define('MGR',MODX_BASE_PATH.MGR_DIR);
8-
/*define('MODX_API_MODE', true);
9-
define('IN_MANAGER_MODE', true);
10-
include_once (MODX_BASE_PATH . '/index.php');*/
11-
$modx = EvolutionCMS();
12-
$modx->invokeEvent('OnManagerPageInit');
13-
if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true || ! $modx->hasPermission('exec_module')) {
4+
evo()->invokeEvent('OnManagerPageInit');
5+
if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true || !evo()->hasPermission('exec_module')) {
146
die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
157
}
168

17-
$moduleurl = MODX_SITE_URL.'assets/modules/store/installer/index.php';
18-
$modulePath = MODX_BASE_PATH.'assets/modules/store/installer/';
19-
$self = $modulePath.'/index.php';
20-
require_once($modulePath."/functions.php");
9+
$moduleurl = MODX_SITE_URL . 'assets/modules/store/installer/index.php';
10+
$modulePath = MODX_BASE_PATH . 'assets/modules/store/installer/';
11+
$self = $modulePath . '/index.php';
12+
require_once($modulePath . "/functions.php");
2113

2214
$_lang = array();
2315
$_params = array();
24-
$lang = $modx->config['manager_language'];
25-
if (file_exists($modulePath.'/lang/'.$lang.'.inc.php')){
26-
include_once($modulePath.'/lang/'.$lang.'.inc.php');
27-
16+
$lang = evo()->config['manager_language'];
17+
if (file_exists($modulePath . '/lang/' . $lang . '.inc.php')){
18+
include_once($modulePath . '/lang/' . $lang . '.inc.php');
2819
} else {
29-
include_once($modulePath.'/lang/en.inc.php');
20+
include_once($modulePath . '/lang/en.inc.php');
3021
}
31-
include_once(MODX_BASE_PATH."assets/cache/siteManager.php");
32-
require_once(MGR.'/includes/version.inc.php');
22+
include_once(MODX_BASE_PATH . "assets/cache/siteManager.php");
23+
require_once(MGR . '/includes/version.inc.php');
3324

3425
$_SESSION['test'] = 1;
3526
install_sessionCheck();
3627

37-
$moduleName = "MODX";
38-
$moduleVersion = $modx_branch.' '.$modx_version;
39-
$moduleRelease = $modx_release_date;
28+
$moduleName = "Evolution CMS";
29+
$moduleVersion = $evo_branch . ' ' . $evo_version;
30+
$moduleRelease = $evo_release_date;
4031
$moduleSQLBaseFile = "setup.sql";
4132
$moduleSQLDataFile = "setup.data.sql";
4233

@@ -52,21 +43,19 @@
5243

5344
// get post back status
5445
$isPostBack = (count($_POST));
55-
$action= isset ($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'load';
46+
$action = isset($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'load';
5647

5748
ob_start();
5849
echo '<!DOCTYPE html>
5950
<html><head><title>Install</title>
6051
<meta http-equiv="Content-Type" content="text/html; charset="utf-8" />
61-
<link rel="stylesheet" href="'.MODX_SITE_URL.'assets/modules/store/installer/style.css" type="text/css" media="screen" /></head>
52+
<link rel="stylesheet" href="' . MODX_SITE_URL . 'assets/modules/store/installer/style.css" type="text/css" media="screen" /></head>
6253
<body><div id="contentarea"><div class="container_12"><br>';
6354

64-
65-
if (!@include ($modulePath.'/action.' . $action . '.php')) {
55+
if (!@include($modulePath.'/action.' . $action . '.php')) {
6656
die ('Invalid install action attempted. [action=' . $action . ']');
6757
}
6858

6959
echo "</div><!-- // content --></div><!-- // contentarea --><br /></body></html>";
7060
ob_end_flush();
71-
7261
?>

0 commit comments

Comments
 (0)