Skip to content

Commit 494db27

Browse files
committed
cli
1 parent 4fe5da8 commit 494db27

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

install/cli-install.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* EVO Cli Installer
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
*/
6-
echo 'Install Evolution CMS?'.PHP_EOL;
6+
77
$path = dirname(__FILE__) . '/';
88

99
/*
@@ -18,15 +18,15 @@
1818
define('MODX_BASE_PATH', $base_path);
1919
define('MODX_SITE_URL', '/');
2020

21-
require_once("functions.php");
21+
require_once($path."functions.php");
2222

2323
// set error reporting
2424
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
2525

26-
if (is_file("../assets/cache/siteManager.php")) {
27-
include_once("../assets/cache/siteManager.php");
26+
if (is_file($path."../assets/cache/siteManager.php")) {
27+
include_once($path."../assets/cache/siteManager.php");
2828
}
29-
if(!defined('MGR_DIR') && is_dir("../manager")) {
29+
if(!defined('MGR_DIR') && is_dir($path."../manager")) {
3030
define('MGR_DIR', 'manager');
3131
}
3232

@@ -58,6 +58,7 @@
5858
$args = array_slice($argv, 1);
5959

6060
if ( empty($args) ){
61+
echo 'Install Evolution CMS?'.PHP_EOL;
6162
$installYes = readline("Type 'y' to continue: ");
6263
if ($installYes != 'y') return;
6364

@@ -166,7 +167,7 @@ function f_owc($path, $data, $mode = null){
166167
// check directories
167168
// cache exists?
168169
echo strip_tags($_lang['checking_if_cache_exist']);
169-
if (!file_exists("../assets/cache") || !file_exists("../assets/cache/rss")) {
170+
if (!file_exists($path."../assets/cache") || !file_exists($path."../assets/cache/rss")) {
170171
echo $_lang['failed'] . PHP_EOL;
171172
$errors++;
172173
} else {
@@ -176,7 +177,7 @@ function f_owc($path, $data, $mode = null){
176177

177178
// cache writable?
178179
echo strip_tags($_lang['checking_if_cache_writable']);
179-
if (!is_writable("../assets/cache")) {
180+
if (!is_writable($path."../assets/cache")) {
180181
$errors++;
181182
echo $_lang['failed'] . PHP_EOL;
182183
} else {
@@ -186,7 +187,7 @@ function f_owc($path, $data, $mode = null){
186187

187188
// cache files writable?
188189
echo strip_tags($_lang['checking_if_cache_file_writable']);
189-
$tmp = "../assets/cache/siteCache.idx.php";
190+
$tmp = $path."../assets/cache/siteCache.idx.php";
190191
if ( ! file_exists($tmp)) {
191192
f_owc($tmp, "<?php //EVO site cache file ?>");
192193
}
@@ -199,7 +200,7 @@ function f_owc($path, $data, $mode = null){
199200

200201

201202
echo strip_tags($_lang['checking_if_cache_file2_writable']);
202-
if ( ! is_writable("../assets/cache/sitePublishing.idx.php")) {
203+
if ( ! is_writable($path."../assets/cache/sitePublishing.idx.php")) {
203204
$errors++;
204205
echo $_lang['failed'] . PHP_EOL;
205206
} else {

0 commit comments

Comments
 (0)