mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-25 05:24:44 +02:00

* simplify setup command * add installer page * add route for installer * adjust gitignore * set colors globally * add "unsaved data changes" alert * add helper method to check if panel is installed * make nicer * redis username isn't required * bring back db settings command * store current date in "installed" file * only redirect if install was successfull * remove fpm requirement * change "installed" marker to env variable * improve requirements step * add commands to change cache, queue or session drivers respectively * removed `grouped` for better mobile view
38 lines
1.3 KiB
PHP
38 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Traits\Commands;
|
|
|
|
trait RequestRedisSettingsTrait
|
|
{
|
|
protected function requestRedisSettings(): void
|
|
{
|
|
$this->output->note(__('commands.appsettings.redis.note'));
|
|
$this->variables['REDIS_HOST'] = $this->option('redis-host') ?? $this->ask(
|
|
'Redis Host',
|
|
config('database.redis.default.host')
|
|
);
|
|
|
|
$askForRedisPassword = true;
|
|
if (!empty(config('database.redis.default.password'))) {
|
|
$this->variables['REDIS_PASSWORD'] = config('database.redis.default.password');
|
|
$askForRedisPassword = $this->confirm('It seems a password is already defined for Redis, would you like to change it?');
|
|
}
|
|
|
|
if ($askForRedisPassword) {
|
|
$this->output->comment(__('commands.appsettings.redis.comment'));
|
|
$this->variables['REDIS_PASSWORD'] = $this->option('redis-pass') ?? $this->output->askHidden(
|
|
'Redis Password'
|
|
);
|
|
}
|
|
|
|
if (empty($this->variables['REDIS_PASSWORD'])) {
|
|
$this->variables['REDIS_PASSWORD'] = 'null';
|
|
}
|
|
|
|
$this->variables['REDIS_PORT'] = $this->option('redis-port') ?? $this->ask(
|
|
'Redis Port',
|
|
config('database.redis.default.port')
|
|
);
|
|
}
|
|
}
|