mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Changed database encoding to utf8mb4_unicode_ci
(#1684)
* Minor improvements * Update install.php * Update install.php * Update install.php * Update install.php * Update CHANGELOG.md * Update install.php * Update install.php * Updated * Update CHANGELOG.md
This commit is contained in:
parent
7474635aed
commit
0cabfb5294
5 changed files with 113 additions and 57 deletions
|
@ -242,6 +242,8 @@ if (!is_file(BB_ROOT . 'vendor/autoload.php')) {
|
|||
out('- Cannot remove Composer installation file (composer-setup.php). Please, delete it manually', 'warning');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out("- composer.phar file found!\n", 'success');
|
||||
}
|
||||
|
||||
// Installing dependencies
|
||||
|
@ -290,7 +292,7 @@ if (is_file(BB_ROOT . '.env')) {
|
|||
if (trim($line) !== '' && !str_starts_with($line, '#')) {
|
||||
$parts = explode('=', $line, 2);
|
||||
$key = trim($parts[0]);
|
||||
$value = isset($parts[1]) ? trim($parts[1]) : '';
|
||||
$value = (isset($parts[1]) && $key !== 'DB_PASSWORD') ? trim($parts[1]) : '';
|
||||
|
||||
// Database default values
|
||||
if (in_array($key, ['DB_HOST', 'DB_PORT', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD'])) {
|
||||
|
@ -301,7 +303,7 @@ if (is_file(BB_ROOT . '.env')) {
|
|||
echo "Enter a new value for $key (or leave empty to not change): ";
|
||||
$newValue = readline();
|
||||
|
||||
if (!empty($newValue)) {
|
||||
if (!empty($newValue) || $key === 'DB_PASSWORD') {
|
||||
$line = "$key=$newValue";
|
||||
// Configuring database connection
|
||||
if (in_array($key, ['DB_HOST', 'DB_PORT', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD'])) {
|
||||
|
@ -348,7 +350,7 @@ if (!empty($DB_HOST) && !empty($DB_DATABASE) && !empty($DB_USERNAME)) {
|
|||
}
|
||||
|
||||
// Creating database if not exist
|
||||
if ($conn->query("CREATE DATABASE IF NOT EXISTS $DB_DATABASE")) {
|
||||
if ($conn->query("CREATE DATABASE IF NOT EXISTS $DB_DATABASE CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci")) {
|
||||
out('- Database created successfully!', 'success');
|
||||
} else {
|
||||
out("- Cannot create database: $DB_DATABASE", 'error');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue