Skip to content

Commit f707aa1

Browse files
committed
fix path
1 parent 494db27 commit f707aa1

1 file changed

Lines changed: 36 additions & 44 deletions

File tree

install/cli-install.php

Lines changed: 36 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
$moduleName = "EVO";
3737
$moduleVersion = $modx_branch.' '.$modx_version;
3838
$moduleRelease = $modx_release_date;
39-
$moduleSQLBaseFile = "setup.sql";
40-
$moduleSQLDataFile = "setup.data.sql";
41-
$moduleSQLResetFile = "setup.data.reset.sql";
39+
$moduleSQLBaseFile = $path."setup.sql";
40+
$moduleSQLDataFile = $path."setup.data.sql";
41+
$moduleSQLResetFile = $path."setup.data.reset.sql";
4242

4343
$moduleChunks = array (); // chunks - array : name, description, type - 0:file or 1:content, file or content
4444
$moduleTemplates = array (); // templates - array : name, description, type - 0:file or 1:content, file or content
@@ -211,9 +211,9 @@ function f_owc($path, $data, $mode = null){
211211
// File Browser directories exists?
212212
echo strip_tags($_lang['checking_if_images_exist']);
213213
switch(true){
214-
case !file_exists("../assets/images"):
215-
case !file_exists("../assets/files"):
216-
case !file_exists("../assets/backup"):
214+
case !file_exists($path."../assets/images"):
215+
case !file_exists($path."../assets/files"):
216+
case !file_exists($path."../assets/backup"):
217217
//case !file_exists("../assets/.thumbs"):
218218
$errors++;
219219
echo $_lang['failed'] . PHP_EOL;
@@ -226,9 +226,9 @@ function f_owc($path, $data, $mode = null){
226226
// File Browser directories writable?
227227
echo strip_tags($_lang['checking_if_images_writable']);
228228
switch(true){
229-
case !is_writable("../assets/images"):
230-
case !is_writable("../assets/files"):
231-
case !is_writable("../assets/backup"):
229+
case !is_writable($path."../assets/images"):
230+
case !is_writable($path."../assets/files"):
231+
case !is_writable($path."../assets/backup"):
232232
//case !is_writable("../assets/.thumbs"):
233233
$errors++;
234234
echo $_lang['failed'] . PHP_EOL;
@@ -240,7 +240,7 @@ function f_owc($path, $data, $mode = null){
240240

241241
// export exists?
242242
echo strip_tags($_lang['checking_if_export_exists']);
243-
if (!file_exists("../assets/export")) {
243+
if (!file_exists($path."../assets/export")) {
244244
echo $_lang['failed'] . PHP_EOL;
245245
$errors++;
246246
} else {
@@ -250,7 +250,7 @@ function f_owc($path, $data, $mode = null){
250250

251251
// export writable?
252252
echo strip_tags($_lang['checking_if_export_writable']);
253-
if (!is_writable("../assets/export")) {
253+
if (!is_writable($path."../assets/export")) {
254254
echo $_lang['failed'] . PHP_EOL;
255255
$errors++;
256256
} else {
@@ -260,7 +260,7 @@ function f_owc($path, $data, $mode = null){
260260

261261
// config.inc.php writable?
262262
echo strip_tags($_lang['checking_if_config_exist_and_writable']);
263-
$tmp = "../".MGR_DIR."/includes/config.inc.php";
263+
$tmp = $path."../".MGR_DIR."/includes/config.inc.php";
264264
if (!is_file($tmp)) {
265265
f_owc($tmp, "<?php //EVO configuration file ?>", 0666);
266266
} else {
@@ -277,7 +277,7 @@ function f_owc($path, $data, $mode = null){
277277

278278
// connect to the database
279279
if ($installMode == 1) {
280-
include "../".MGR_DIR."/includes/config.inc.php";
280+
include $path."../".MGR_DIR."/includes/config.inc.php";
281281
} else {
282282
// get db info from post
283283
$database_server = $databasehost;
@@ -381,13 +381,13 @@ function f_owc($path, $data, $mode = null){
381381

382382
// andrazk 20070416 - add install flag and disable manager login
383383
// assets/cache writable?
384-
if (is_writable("../assets/cache")) {
385-
if (file_exists('../assets/cache/installProc.inc.php')) {
386-
@chmod('../assets/cache/installProc.inc.php', 0755);
387-
unlink('../assets/cache/installProc.inc.php');
384+
if (is_writable($path."../assets/cache")) {
385+
if (file_exists($path.'../assets/cache/installProc.inc.php')) {
386+
@chmod($path.'../assets/cache/installProc.inc.php', 0755);
387+
unlink($path.'../assets/cache/installProc.inc.php');
388388
}
389389

390-
f_owc("../assets/cache/installProc.inc.php", '<?php $installStartTime = '.time().'; ?>');
390+
f_owc($path."../assets/cache/installProc.inc.php", '<?php $installStartTime = '.time().'; ?>');
391391
}
392392

393393
if($installMode > 0 && $_POST['installdata'] == "1") {
@@ -409,14 +409,6 @@ function f_owc($path, $data, $mode = null){
409409

410410

411411
//////////////////////////////////////////////////////////////////////////////////////
412-
413-
if (file_exists(dirname(__FILE__)."/../assets/cache/siteManager.php")) {
414-
include_once(dirname(__FILE__)."/../assets/cache/siteManager.php");
415-
}else{
416-
define('MGR_DIR', 'manager');
417-
}
418-
419-
420412
$create = false;
421413

422414
// set timout limit
@@ -427,7 +419,7 @@ function f_owc($path, $data, $mode = null){
427419

428420

429421
if ($installMode == 1) {
430-
include "../".MGR_DIR."/includes/config.inc.php";
422+
include $path."../".MGR_DIR."/includes/config.inc.php";
431423
} else {
432424
// get db info from post
433425
$database_server = $databasehost;
@@ -576,12 +568,12 @@ function parseProperties($propertyString) {
576568

577569
// open db connection
578570
$setupPath = realpath(dirname(__FILE__));
579-
$chunkPath = 'assets/chunks';
580-
$snippetPath = 'assets/snippets';
581-
$pluginPath = 'assets/plugins';
582-
$modulePath = 'assets/modules';
583-
$templatePath = 'assets/templates';
584-
$tvPath = 'assets/tvs';
571+
$chunkPath = $path.'assets/chunks';
572+
$snippetPath = $path.'assets/snippets';
573+
$pluginPath = $path.'assets/plugins';
574+
$modulePath = $path.'assets/modules';
575+
$templatePath = $path.'assets/templates';
576+
$tvPath = $path.'assets/tvs';
585577

586578
// setup Template template files - array : name, description, type - 0:file or 1:content, parameters, category
587579
$mt = &$moduleTemplates;
@@ -917,7 +909,7 @@ function parse_docblock($element_dir, $filename) {
917909
}
918910

919911

920-
include "{$setupPath}/sqlParser.class.php";
912+
include $path."sqlParser.class.php";
921913
$sqlParser = new SqlParser($database_server, $database_user, $database_password, str_replace("`", "", $dbase), $table_prefix, $adminname, $adminemail, $adminpass, $database_connection_charset, $managerlanguage, $database_connection_method, $auto_template_logic);
922914
$sqlParser->mode = ($installMode < 1) ? "new" : "upd";
923915
/* image and file manager paths now handled via settings screen in Manager
@@ -950,7 +942,7 @@ function parse_docblock($element_dir, $filename) {
950942
}
951943

952944
// custom or not
953-
if (file_exists(dirname(__FILE__)."/../../assets/cache/siteManager.php")) {
945+
if (file_exists($path."../assets/cache/siteManager.php")) {
954946
$mgrdir = 'include_once(dirname(__FILE__)."/../../assets/cache/siteManager.php");';
955947
}else{
956948
$mgrdir = 'define(\'MGR_DIR\', \'manager\');';
@@ -973,7 +965,7 @@ function parse_docblock($element_dir, $filename) {
973965
$configString = file_get_contents('config.inc.tpl');
974966
$configString = parse($configString, $confph);
975967

976-
$filename = '../'.MGR_DIR.'/includes/config.inc.php';
968+
$filename = $path.'../'.MGR_DIR.'/includes/config.inc.php';
977969
$configFileFailed = false;
978970
if (@ !$handle = fopen($filename, 'w')) {
979971
$configFileFailed = true;
@@ -1499,19 +1491,19 @@ function parse_docblock($element_dir, $filename) {
14991491
if (!defined('MODX_MANAGER_PATH')) define('MODX_MANAGER_PATH', $base_path.MGR_DIR.'/');
15001492
$database_type = 'mysqli';
15011493
// initiate a new document parser
1502-
include_once('../'.MGR_DIR.'/includes/document.parser.class.inc.php');
1494+
include_once($path.'../'.MGR_DIR.'/includes/document.parser.class.inc.php');
15031495
$modx = new DocumentParser;
15041496
$modx->db->connect();
15051497
// always empty cache after install
1506-
include_once "../".MGR_DIR."/processors/cache_sync.class.processor.php";
1498+
include_once $path."../".MGR_DIR."/processors/cache_sync.class.processor.php";
15071499
$sync = new synccache();
1508-
$sync->setCachepath("../assets/cache/");
1500+
$sync->setCachepath($path."../assets/cache/");
15091501
$sync->setReport(false);
15101502
$sync->emptyCache(); // first empty the cache
15111503

15121504
// try to chmod the cache go-rwx (for suexeced php)
1513-
$chmodSuccess = @chmod('../assets/cache/siteCache.idx.php', 0600);
1514-
$chmodSuccess = @chmod('../assets/cache/sitePublishing.idx.php', 0600);
1505+
$chmodSuccess = @chmod($path.'../assets/cache/siteCache.idx.php', 0600);
1506+
$chmodSuccess = @chmod($path.'../assets/cache/sitePublishing.idx.php', 0600);
15151507

15161508
// remove any locks on the manager functions so initial manager login is not blocked
15171509
mysqli_query($conn, "TRUNCATE TABLE `".$table_prefix."active_users`");
@@ -1520,9 +1512,9 @@ function parse_docblock($element_dir, $filename) {
15201512
$sqlParser->close();
15211513

15221514
// andrazk 20070416 - release manager access
1523-
if (file_exists('../assets/cache/installProc.inc.php')) {
1524-
@chmod('../assets/cache/installProc.inc.php', 0755);
1525-
unlink('../assets/cache/installProc.inc.php');
1515+
if (file_exists($path.'../assets/cache/installProc.inc.php')) {
1516+
@chmod($path.'../assets/cache/installProc.inc.php', 0755);
1517+
unlink($path.'../assets/cache/installProc.inc.php');
15261518
}
15271519

15281520
// setup completed!

0 commit comments

Comments
 (0)