diff --git a/core/install.php b/core/install.php index ccf8f3a5..3d51bef4 100644 --- a/core/install.php +++ b/core/install.php @@ -46,7 +46,11 @@ function install(): void if ($dsn) { do_install($dsn); } else { - ask_questions(); + if(PHP_SAPI == 'cli') { + print("INSTALL_DSN needs to be set for CLI installation\n"); + } else { + ask_questions(); + } } } @@ -310,11 +314,16 @@ function write_config(string $dsn): void } if (file_put_contents("data/config/shimmie.conf.php", $file_content, LOCK_EX)) { - header("Location: index.php?flash=Installation%20complete"); - die_nicely( - "Installation Successful", - "

If you aren't redirected, click here to Continue." - ); + if(PHP_SAPI == 'cli') { + print("Installation Successful\n"); + exit(0); + } else { + header("Location: index.php?flash=Installation%20complete"); + die_nicely( + "Installation Successful", + "

If you aren't redirected, click here to Continue." + ); + } } else { $h_file_content = htmlentities($file_content); throw new InstallerException(