Skip to content

Commit 940a292

Browse files
authored
Merge pull request #711 from AgelxNash/fix-install
Update installer
2 parents a90c153 + dda339c commit 940a292

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545

4646
# Manager
4747
/manager/includes/config.inc.php
48+
/manager/includes/config_mutator.php
4849

4950
# Composer
5051
/composer.phar

install/actions/action_options.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ function getSnippets($presets = array())
188188
$database_collation = isset($_POST['database_collation']) ? $_POST['database_collation'] : 'utf8_general_ci';
189189
$database_charset = substr($database_collation, 0, strpos($database_collation, '_'));
190190
$_POST['database_connection_charset'] = $database_charset;
191-
if(empty($_SESSION['databaseloginpassword']))
191+
if(!empty($_POST['databaseloginpassword']))
192192
$_SESSION['databaseloginpassword'] = $_POST['databaseloginpassword'];
193-
if(empty($_SESSION['databaseloginname']))
193+
if(!empty($_POST['databaseloginname']))
194194
$_SESSION['databaseloginname'] = $_POST['databaseloginname'];
195195
break;
196196
case 1:

install/config.inc.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ $coreClass = '\DocumentParser';
1818
$session_cookie_path = '';
1919
$session_cookie_domain = '';
2020

21+
/**
22+
* Preventing the overwrite of the config when updating
23+
* Here you can
24+
* - define manual constants, dedicated specifically for you project
25+
* - inject composer
26+
* - change predefined variables by the environment variables
27+
* - ...
28+
* - etc.
29+
* - PROFIT!
30+
*/
31+
if (file_exists(__DIR__ . '/config_mutator.php')) {
32+
require_once __DIR__ . '/config_mutator.php';
33+
}
34+
2135
if (!defined('MGR_DIR')) {
2236
define('MGR_DIR', 'manager');
2337
}

install/instprocessor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
}else{
55
define('MGR_DIR', 'manager');
66
}
7+
define('MODX_CLI', false);
78

89
global $moduleName;
910
global $moduleVersion;

0 commit comments

Comments
 (0)