Skip to content

Commit

Permalink
[FIX] Refactor installation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Seiger committed Dec 6, 2023
1 parent 5ce5a69 commit fe7f44c
Show file tree
Hide file tree
Showing 49 changed files with 264 additions and 351 deletions.
49 changes: 19 additions & 30 deletions assets/modules/store/installer/index.php
Original file line number Diff line number Diff line change
@@ -1,42 +1,33 @@
<?php
/*
error_reporting(E_ALL & ~E_NOTICE);
define('MGR', MODX_BASE_PATH . MGR_DIR);

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

$moduleurl = MODX_SITE_URL.'assets/modules/store/installer/index.php';
$modulePath = MODX_BASE_PATH.'assets/modules/store/installer/';
$self = $modulePath.'/index.php';
require_once($modulePath."/functions.php");
$moduleurl = MODX_SITE_URL . 'assets/modules/store/installer/index.php';
$modulePath = MODX_BASE_PATH . 'assets/modules/store/installer/';
$self = $modulePath . '/index.php';
require_once($modulePath . "/functions.php");

$_lang = array();
$_params = array();
$lang = $modx->config['manager_language'];
if (file_exists($modulePath.'/lang/'.$lang.'.inc.php')){
include_once($modulePath.'/lang/'.$lang.'.inc.php');

$lang = evo()->config['manager_language'];
if (file_exists($modulePath . '/lang/' . $lang . '.inc.php')){
include_once($modulePath . '/lang/' . $lang . '.inc.php');
} else {
include_once($modulePath.'/lang/en.inc.php');
include_once($modulePath . '/lang/en.inc.php');
}
include_once(MODX_BASE_PATH."assets/cache/siteManager.php");
require_once(MGR.'/includes/version.inc.php');
include_once(MODX_BASE_PATH . "assets/cache/siteManager.php");
require_once(MGR . '/includes/version.inc.php');

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

$moduleName = "MODX";
$moduleVersion = $modx_branch.' '.$modx_version;
$moduleRelease = $modx_release_date;
$moduleName = "Evolution CMS";
$moduleVersion = $evo_branch . ' ' . $evo_version;
$moduleRelease = $evo_release_date;
$moduleSQLBaseFile = "setup.sql";
$moduleSQLDataFile = "setup.data.sql";

Expand All @@ -52,21 +43,19 @@

// get post back status
$isPostBack = (count($_POST));
$action= isset ($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'load';
$action = isset($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'load';

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


if (!@include ($modulePath.'/action.' . $action . '.php')) {
if (!@include($modulePath.'/action.' . $action . '.php')) {
die ('Invalid install action attempted. [action=' . $action . ']');
}

echo "</div><!-- // content --></div><!-- // contentarea --><br /></body></html>";
ob_end_flush();

?>
Loading

0 comments on commit fe7f44c

Please sign in to comment.