$this->error('The site domain cannot start with https://, you must use the FQDN (eg: example.org)');
$this->error('The site domain cannot start with https://, you must use the FQDN (eg: example.org)');
exit;
exit;
}
}
if(strpos($domain, '.') == false) {
if(strpos($domain, '.') == false) {
$this->error('You must enter a valid site domain');
$this->error('You must enter a valid site domain');
exit;
exit;
}
}
@ -381,11 +369,11 @@ class Installer extends Command
$this->info('Media Settings:');
$this->info('Media Settings:');
$optimize_media = $this->choice('Optimize media uploads? Requires jpegoptim and other dependencies!', ['false', 'true'], 1);
$optimize_media = $this->choice('Optimize media uploads? Requires jpegoptim and other dependencies!', ['false', 'true'], 1);
$image_quality = $this->ask('Set image optimization quality between 1-100. Default is 80%, lower values use less disk space at the expense of image quality.', '80');
$image_quality = $this->ask('Set image optimization quality between 1-100. Default is 80%, lower values use less disk space at the expense of image quality.', '80');
if($image_quality <1){
if($image_quality <1){
$this->error('Min image quality is 1. You should avoid such a low value, 60 at minimum is recommended.');
$this->error('Min image quality is 1. You should avoid such a low value, 60 at minimum is recommended.');
exit;
exit;
}
}
if($image_quality > 100) {
if($image_quality > 100) {
$this->error('Max image quality is 100');
$this->error('Max image quality is 100');
exit;
exit;
}
}
@ -393,17 +381,17 @@ class Installer extends Command
$max_photo_size = $this->ask('Max photo upload size in kilobytes. Default 15000 which is equal to 15MB', '15000');
$max_photo_size = $this->ask('Max photo upload size in kilobytes. Default 15000 which is equal to 15MB', '15000');
$max_caption_length = $this->ask('Max caption limit. Default to 500, max 5000.', '500');
$max_caption_length = $this->ask('Max caption limit. Default to 500, max 5000.', '500');
if($max_caption_length > 5000) {
if($max_caption_length > 5000) {
$this->error('Max caption length is 5000 characters.');
$this->error('Max caption length is 5000 characters.');
exit;
exit;
}
}
$max_album_length = $this->ask('Max photos allowed per album. Choose a value between 1 and 10.', '4');
$max_album_length = $this->ask('Max photos allowed per album. Choose a value between 1 and 10.', '4');
if($max_album_length <1){
if($max_album_length <1){
$this->error('Min album length is 1 photos per album.');
$this->error('Min album length is 1 photos per album.');
exit;
exit;
}
}
if($max_album_length > 10) {
if($max_album_length > 10) {
$this->error('Max album length is 10 photos per album.');
$this->error('Max album length is 10 photos per album.');
exit;
exit;
}
}
@ -421,7 +409,7 @@ class Installer extends Command
$this->info('Note: We recommend running database migrations now!');
$this->info('Note: We recommend running database migrations now!');
$confirm = $this->choice('Do you want to run the database migrations?', ['Yes', 'No'], 0);
$confirm = $this->choice('Do you want to run the database migrations?', ['Yes', 'No'], 0);
if($confirm === 'Yes') {
if($confirm === 'Yes') {
sleep(3);
sleep(3);
$this->line('');
$this->line('');
$this->info('Migrating DB:');
$this->info('Migrating DB:');
@ -437,7 +425,7 @@ class Installer extends Command