Skip to content

Commit d9f2a0d

Browse files
committed
fix cli
1 parent 95126cb commit d9f2a0d

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

install/cli-install.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,8 @@
44
* php cli-install.php --database_server=localhost --database=db --database_user=dbuser --database_password=dbpass --table_prefix=evo_ --cmsadmin=admin --cmsadminemail=dmi3yy@gmail.com --cmspassword=123456 --language=ru --mode=new --installData=n --removeInstall=y
55
*/
66

7+
$self = 'install/cli-install.php';
78
$path = dirname(__FILE__) . '/';
8-
9-
/*
10-
$autoloader = realpath(__DIR__.'/../vendor/autoload.php');
11-
if (file_exists($autoloader) && is_readable($autoloader)) {
12-
include_once($autoloader);
13-
}*/
14-
15-
$self = 'install/index.php';
169
$base_path = str_replace($self,'',str_replace('\\','/', __FILE__));
1710
define('MODX_API_MODE', true);
1811
define('MODX_BASE_PATH', $base_path);
@@ -23,15 +16,15 @@
2316
// set error reporting
2417
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
2518

26-
if (is_file($path."../assets/cache/siteManager.php")) {
27-
include_once($path."../assets/cache/siteManager.php");
19+
if (is_file($base_path."assets/cache/siteManager.php")) {
20+
include_once($base_path."assets/cache/siteManager.php");
2821
}
29-
if(!defined('MGR_DIR') && is_dir($path."../manager")) {
22+
if(!defined('MGR_DIR') && is_dir($base_path."manager")) {
3023
define('MGR_DIR', 'manager');
3124
}
3225

3326
require_once($path."lang.php");
34-
require_once($path.'../'.MGR_DIR.'/includes/version.inc.php');
27+
require_once($base_path.MGR_DIR.'/includes/version.inc.php');
3528

3629
$moduleName = "EVO";
3730
$moduleVersion = $modx_branch.' '.$modx_version;
@@ -962,10 +955,10 @@ function parse_docblock($element_dir, $filename) {
962955
$confph['lastInstallTime'] = time();
963956
$confph['site_sessionname'] = $site_sessionname;
964957

965-
$configString = file_get_contents('config.inc.tpl');
958+
$configString = file_get_contents($path.'config.inc.tpl');
966959
$configString = parse($configString, $confph);
967960

968-
$filename = $path.'../'.MGR_DIR.'/includes/config.inc.php';
961+
$filename = $base_path.MGR_DIR.'/includes/config.inc.php';
969962
$configFileFailed = false;
970963
if (@ !$handle = fopen($filename, 'w')) {
971964
$configFileFailed = true;

0 commit comments

Comments
 (0)