Merge pull request #1446 from prashant-webkul/development
Command line installer fix
This commit is contained in:
commit
9a443b6f3b
|
|
@ -62,19 +62,19 @@ class BagistoInstall extends Command
|
||||||
|
|
||||||
$APP_URL = $this->ask('[KEY = "APP_URL"] Please enter application URL (Optional, default = localhost)?');
|
$APP_URL = $this->ask('[KEY = "APP_URL"] Please enter application URL (Optional, default = localhost)?');
|
||||||
$this->comment($APP_URL ?? 'localhost');
|
$this->comment($APP_URL ?? 'localhost');
|
||||||
$this->changeEnvironmentVariable('APP_URL', $APP_URL);
|
$this->changeEnvironmentVariable('APP_URL', $APP_URL ?? 'http://localhost');
|
||||||
|
|
||||||
$DB_CONNECTION = $this->ask('[KEY = "DB_CONNECTION"] Enter database connection (Optional, default = mysql)?');
|
$DB_CONNECTION = $this->ask('[KEY = "DB_CONNECTION"] Enter database connection (Optional, default = mysql)?');
|
||||||
$this->comment($DB_CONNECTION ?? 'mysql');
|
$this->comment($DB_CONNECTION ?? 'mysql');
|
||||||
$this->changeEnvironmentVariable('DB_CONNECTION', $DB_CONNECTION);
|
$this->changeEnvironmentVariable('DB_CONNECTION', $DB_CONNECTION ?? 'mysql');
|
||||||
|
|
||||||
$DB_HOST = $this->ask('[KEY = "DB_HOST"] Enter database host (Optional, default = 127.0.0.1)?');
|
$DB_HOST = $this->ask('[KEY = "DB_HOST"] Enter database host (Optional, default = 127.0.0.1)?');
|
||||||
$this->comment($DB_HOST ?? '127.0.0.1');
|
$this->comment($DB_HOST ?? '127.0.0.1');
|
||||||
$this->changeEnvironmentVariable('DB_HOST', $DB_HOST);
|
$this->changeEnvironmentVariable('DB_HOST', $DB_HOST ?? '127.0.0.1');
|
||||||
|
|
||||||
$DB_PORT = $this->ask('[KEY = "DB_PORT"] Enter database port (Optional, default = 3306)?');
|
$DB_PORT = $this->ask('[KEY = "DB_PORT"] Enter database port (Optional, default = 3306)?');
|
||||||
$this->comment($DB_PORT ?? '3306');
|
$this->comment($DB_PORT ?? '3306');
|
||||||
$this->changeEnvironmentVariable('DB_PORT', $DB_PORT);
|
$this->changeEnvironmentVariable('DB_PORT', $DB_PORT ?? '3306');
|
||||||
|
|
||||||
$DB_DATABASE = null;
|
$DB_DATABASE = null;
|
||||||
|
|
||||||
|
|
@ -83,7 +83,7 @@ class BagistoInstall extends Command
|
||||||
$this->comment($DB_DATABASE ?? 'forge');
|
$this->comment($DB_DATABASE ?? 'forge');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->changeEnvironmentVariable('DB_DATABASE', $DB_DATABASE);
|
$this->changeEnvironmentVariable('DB_DATABASE', $DB_DATABASE ?? 'forge');
|
||||||
|
|
||||||
$DB_USERNAME = null;
|
$DB_USERNAME = null;
|
||||||
|
|
||||||
|
|
@ -92,11 +92,11 @@ class BagistoInstall extends Command
|
||||||
$this->comment($DB_USERNAME ?? 'root');
|
$this->comment($DB_USERNAME ?? 'root');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->changeEnvironmentVariable('[KEY = "DB_USERNAME"] DB_USERNAME', $DB_USERNAME);
|
$this->changeEnvironmentVariable('DB_USERNAME', $DB_USERNAME ?? root);
|
||||||
|
|
||||||
$DB_PASSWORD = $this->ask('Please enter database password?');
|
$DB_PASSWORD = $this->ask('Please enter database password?');
|
||||||
$this->comment($DB_PASSWORD);
|
$this->comment($DB_PASSWORD);
|
||||||
$this->changeEnvironmentVariable('[KEY = "DB_PASSWORD"] DB_PASSWORD', $DB_PASSWORD);
|
$this->changeEnvironmentVariable('DB_PASSWORD', $DB_PASSWORD);
|
||||||
|
|
||||||
$this->info('We are done with application and database params, good job!');
|
$this->info('We are done with application and database params, good job!');
|
||||||
|
|
||||||
|
|
@ -116,11 +116,11 @@ class BagistoInstall extends Command
|
||||||
|
|
||||||
$MAIL_USERNAME = $this->ask('[KEY = "MAIL_USERNAME"] Enter MAIL_USERNAME?');
|
$MAIL_USERNAME = $this->ask('[KEY = "MAIL_USERNAME"] Enter MAIL_USERNAME?');
|
||||||
$this->comment($MAIL_USERNAME ?? null);
|
$this->comment($MAIL_USERNAME ?? null);
|
||||||
$this->changeEnvironmentVariable('MAIL_USERNAME', $MAIL_USERNAME);
|
$this->changeEnvironmentVariable('MAIL_USERNAME', $MAIL_USERNAME ?? null);
|
||||||
|
|
||||||
$MAIL_PASSWORD = $this->ask('[KEY = "MAIL_PASSWORD"] Enter MAIL_PASSWORD?');
|
$MAIL_PASSWORD = $this->ask('[KEY = "MAIL_PASSWORD"] Enter MAIL_PASSWORD?');
|
||||||
$this->comment($MAIL_PASSWORD ?? null);
|
$this->comment($MAIL_PASSWORD ?? null);
|
||||||
$this->changeEnvironmentVariable('MAIL_PASSWORD', $MAIL_PASSWORD);
|
$this->changeEnvironmentVariable('MAIL_PASSWORD', $MAIL_PASSWORD ?? null);
|
||||||
|
|
||||||
$MAIL_ENCRYPTION = $this->ask('[KEY = "MAIL_ENCRYPTION"] Enter MAIL_ENCRYPTION (default = tls)?');
|
$MAIL_ENCRYPTION = $this->ask('[KEY = "MAIL_ENCRYPTION"] Enter MAIL_ENCRYPTION (default = tls)?');
|
||||||
$this->comment($MAIL_ENCRYPTION ?? 'tls');
|
$this->comment($MAIL_ENCRYPTION ?? 'tls');
|
||||||
|
|
@ -128,18 +128,18 @@ class BagistoInstall extends Command
|
||||||
|
|
||||||
$SHOP_MAIL_FROM = $this->ask('[KEY = "SHOP_MAIL_FROM"] Enter SHOP_MAIL_FROM?');
|
$SHOP_MAIL_FROM = $this->ask('[KEY = "SHOP_MAIL_FROM"] Enter SHOP_MAIL_FROM?');
|
||||||
$this->comment($SHOP_MAIL_FROM ?? null);
|
$this->comment($SHOP_MAIL_FROM ?? null);
|
||||||
$this->changeEnvironmentVariable('SHOP_MAIL_FROM', $SHOP_MAIL_FROM);
|
$this->changeEnvironmentVariable('SHOP_MAIL_FROM', $SHOP_MAIL_FROM ?? null);
|
||||||
|
|
||||||
$ADMIN_MAIL_TO = $this->ask('[KEY = "ADMIN_MAIL_TO"] Enter ADMIN_MAIL_TO?');
|
$ADMIN_MAIL_TO = $this->ask('[KEY = "ADMIN_MAIL_TO"] Enter ADMIN_MAIL_TO?');
|
||||||
$this->comment($ADMIN_MAIL_TO ?? null);
|
$this->comment($ADMIN_MAIL_TO ?? null);
|
||||||
$this->changeEnvironmentVariable('ADMIN_MAIL_TO', $ADMIN_MAIL_TO);
|
$this->changeEnvironmentVariable('ADMIN_MAIL_TO', $ADMIN_MAIL_TO ?? null);
|
||||||
|
|
||||||
$this->info('We are done setting all the configuration in the env file, now we will proceed by running the commands necessary for Bagisto');
|
$this->line('We are done setting all the configuration in the env file, now we will proceed by running the commands necessary for Bagisto');
|
||||||
|
|
||||||
\Artisan::call('config:cache');
|
|
||||||
|
|
||||||
$this->info('Running migrations...');
|
$this->info('Running migrations...');
|
||||||
|
|
||||||
|
\Artisan::call('key:generate');
|
||||||
|
|
||||||
\Artisan::call('migrate');
|
\Artisan::call('migrate');
|
||||||
|
|
||||||
$this->info('Migration completed.');
|
$this->info('Migration completed.');
|
||||||
|
|
@ -160,13 +160,16 @@ class BagistoInstall extends Command
|
||||||
|
|
||||||
$this->info('Installation completed.');
|
$this->info('Installation completed.');
|
||||||
|
|
||||||
$this->info('Please write us: SUPPORT@BAGISTO.COM');
|
$this->Line('Please write us: SUPPORT@BAGISTO.COM');
|
||||||
|
|
||||||
$this->info('Thank you!!!');
|
$this->Line('Thank you!!!');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function changeEnvironmentVariable($key, $value)
|
public static function changeEnvironmentVariable($key, $value)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
\Artisan::call('config:cache');
|
||||||
|
|
||||||
$path = base_path('.env');
|
$path = base_path('.env');
|
||||||
|
|
||||||
if (file_exists($path)) {
|
if (file_exists($path)) {
|
||||||
|
|
@ -177,5 +180,7 @@ class BagistoInstall extends Command
|
||||||
file_get_contents($path)
|
file_get_contents($path)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
\Artisan::call('config:cache');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -175,7 +175,9 @@ class CartRuleController extends Controller
|
||||||
// unset labels
|
// unset labels
|
||||||
unset($data['label']);
|
unset($data['label']);
|
||||||
|
|
||||||
|
while (gettype($attribute_conditions) == 'string') {
|
||||||
$attribute_conditions = json_decode($attribute_conditions);
|
$attribute_conditions = json_decode($attribute_conditions);
|
||||||
|
}
|
||||||
|
|
||||||
if (! isset($attribute_conditions) || ! (count($attribute_conditions->categories) || count($attribute_conditions->attributes))) {
|
if (! isset($attribute_conditions) || ! (count($attribute_conditions->categories) || count($attribute_conditions->attributes))) {
|
||||||
$data['uses_attribute_conditions'] = 0;
|
$data['uses_attribute_conditions'] = 0;
|
||||||
|
|
@ -405,6 +407,10 @@ class CartRuleController extends Controller
|
||||||
// prepare actions from data for json action
|
// prepare actions from data for json action
|
||||||
$attribute_conditions = json_decode($attribute_conditions);
|
$attribute_conditions = json_decode($attribute_conditions);
|
||||||
|
|
||||||
|
while (gettype($attribute_conditions) == 'string') {
|
||||||
|
$attribute_conditions = json_decode($attribute_conditions);
|
||||||
|
}
|
||||||
|
|
||||||
if (! isset($attribute_conditions) || ! (count($attribute_conditions->categories) || count($attribute_conditions->attributes))) {
|
if (! isset($attribute_conditions) || ! (count($attribute_conditions->categories) || count($attribute_conditions->attributes))) {
|
||||||
$data['uses_attribute_conditions'] = 0;
|
$data['uses_attribute_conditions'] = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ Vue.component("image-slider", require("./components/image-slider.vue"));
|
||||||
Vue.component("vue-slider", require("vue-slider-component"));
|
Vue.component("vue-slider", require("vue-slider-component"));
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
el: "#app",
|
el: "#app",
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue