Clean up .env files
This commit is contained in:
parent
8cb65dd846
commit
a87320fe09
61
.env.example
61
.env.example
|
|
@ -1,31 +1,14 @@
|
||||||
###################################
|
APP_DEBUG=false
|
||||||
# Blessing Skin Server #
|
APP_ENV=production
|
||||||
# Configuration #
|
WEBPACK_ENV=production
|
||||||
###################################
|
|
||||||
|
|
||||||
# 本文件中各个配置项的详细说明
|
DB_CONNECTION=mysql
|
||||||
# 请访问 http://t.cn/E9G4DTY 查看中文教程
|
DB_HOST=localhost
|
||||||
|
DB_PORT=3306
|
||||||
# Be sure to disable debug at production environment!
|
DB_DATABASE=blessingskin
|
||||||
APP_DEBUG = false
|
DB_USERNAME=username
|
||||||
APP_ENV = production
|
DB_PASSWORD=secret
|
||||||
WEBPACK_ENV = production
|
DB_PREFIX=
|
||||||
|
|
||||||
# Database Configuration
|
|
||||||
DB_CONNECTION = mysql
|
|
||||||
DB_HOST = localhost
|
|
||||||
DB_PORT = 3306
|
|
||||||
DB_DATABASE = blessingskin
|
|
||||||
DB_USERNAME = username
|
|
||||||
DB_PASSWORD = secret
|
|
||||||
# =========================
|
|
||||||
|
|
||||||
# Table Prefix
|
|
||||||
#
|
|
||||||
# Change if you want to install multiple BS instances into one database.
|
|
||||||
# The prefix may only contain letters, numbers, and underscores.
|
|
||||||
#
|
|
||||||
DB_PREFIX = null
|
|
||||||
|
|
||||||
# Hash Algorithm for Passwords
|
# Hash Algorithm for Passwords
|
||||||
#
|
#
|
||||||
|
|
@ -37,26 +20,10 @@ DB_PREFIX = null
|
||||||
#
|
#
|
||||||
# New sites are *highly* recommended to use BCRYPT.
|
# New sites are *highly* recommended to use BCRYPT.
|
||||||
#
|
#
|
||||||
PWD_METHOD = BCRYPT
|
PWD_METHOD=BCRYPT
|
||||||
|
SALT=2c5ca184f017a9a1ffbd198ef69b0c0e
|
||||||
|
APP_KEY=
|
||||||
|
|
||||||
# Salt
|
|
||||||
# Change it to any random string to secure your passwords & tokens.
|
|
||||||
#
|
|
||||||
# You can run [php artisan salt:random] to generate a new salt.
|
|
||||||
#
|
|
||||||
SALT = 2c5ca184f017a9a1ffbd198ef69b0c0e
|
|
||||||
|
|
||||||
# App Key should be setted to any random, *32 character* string,
|
|
||||||
# otherwise all the encrypted strings will not be safe.
|
|
||||||
#
|
|
||||||
# You can run [php artisan key:generate] to generate a new key.
|
|
||||||
#
|
|
||||||
APP_KEY=base64:gkb/zouNF6UOSfnr/o+izVMS57WQS3+62YqZBuDyBhU=
|
|
||||||
|
|
||||||
# Mail Configuration
|
|
||||||
#
|
|
||||||
# Leave MAIL_DRIVER empty to disable features involving sending emails.
|
|
||||||
#
|
|
||||||
MAIL_DRIVER = smtp
|
MAIL_DRIVER = smtp
|
||||||
MAIL_HOST = null
|
MAIL_HOST = null
|
||||||
MAIL_PORT = 465
|
MAIL_PORT = 465
|
||||||
|
|
@ -64,11 +31,11 @@ MAIL_USERNAME = null
|
||||||
MAIL_PASSWORD = null
|
MAIL_PASSWORD = null
|
||||||
MAIL_ENCRYPTION = null
|
MAIL_ENCRYPTION = null
|
||||||
|
|
||||||
# Change below lines only if you know what they mean!
|
|
||||||
CACHE_DRIVER = file
|
CACHE_DRIVER = file
|
||||||
SESSION_DRIVER = file
|
SESSION_DRIVER = file
|
||||||
QUEUE_DRIVER = sync
|
QUEUE_DRIVER = sync
|
||||||
|
|
||||||
|
REDIS_CLIENT=predis
|
||||||
REDIS_HOST = 127.0.0.1
|
REDIS_HOST = 127.0.0.1
|
||||||
REDIS_PASSWORD = null
|
REDIS_PASSWORD = null
|
||||||
REDIS_PORT = 6379
|
REDIS_PORT = 6379
|
||||||
|
|
|
||||||
59
.env.testing
59
.env.testing
|
|
@ -1,40 +1,35 @@
|
||||||
###################################
|
APP_DEBUG=false
|
||||||
# Blessing Skin Server #
|
APP_ENV=testing
|
||||||
# Configuration #
|
|
||||||
###################################
|
|
||||||
|
|
||||||
APP_DEBUG = false
|
DB_CONNECTION=mysql
|
||||||
APP_ENV = testing
|
DB_HOST=127.0.0.1
|
||||||
|
DB_PORT=3306
|
||||||
|
DB_DATABASE=test
|
||||||
|
DB_USERNAME=root
|
||||||
|
DB_PASSWORD=root
|
||||||
|
DB_PREFIX=
|
||||||
|
|
||||||
DB_CONNECTION = mysql
|
PWD_METHOD=BCRYPT
|
||||||
DB_HOST = 127.0.0.1
|
SALT=c67709dd8b7b733aca0d570681fe96cf
|
||||||
DB_PORT = 3306
|
|
||||||
DB_DATABASE = test
|
|
||||||
DB_USERNAME = root
|
|
||||||
DB_PASSWORD = root
|
|
||||||
DB_PREFIX = null
|
|
||||||
|
|
||||||
PWD_METHOD = BCRYPT
|
|
||||||
SALT = c67709dd8b7b733aca0d570681fe96cf
|
|
||||||
APP_KEY=base64:eVX/xzF5NhpGB2luswliFx9XSBsbbAP21wOi68X/P34=
|
APP_KEY=base64:eVX/xzF5NhpGB2luswliFx9XSBsbbAP21wOi68X/P34=
|
||||||
|
|
||||||
MAIL_DRIVER = smtp
|
MAIL_DRIVER=smtp
|
||||||
MAIL_HOST = localhost
|
MAIL_HOST=localhost
|
||||||
MAIL_PORT = 465
|
MAIL_PORT=465
|
||||||
MAIL_USERNAME = null
|
MAIL_USERNAME=
|
||||||
MAIL_PASSWORD = null
|
MAIL_PASSWORD=
|
||||||
MAIL_ENCRYPTION = ssl
|
MAIL_ENCRYPTION=ssl
|
||||||
|
|
||||||
CACHE_DRIVER = array
|
CACHE_DRIVER=array
|
||||||
SESSION_DRIVER = array
|
SESSION_DRIVER=array
|
||||||
QUEUE_DRIVER = sync
|
QUEUE_DRIVER=sync
|
||||||
LOG_CHANNEL = black-hole
|
LOG_CHANNEL=black-hole
|
||||||
|
|
||||||
REDIS_HOST = 127.0.0.1
|
REDIS_HOST=127.0.0.1
|
||||||
REDIS_PASSWORD = null
|
REDIS_PASSWORD=
|
||||||
REDIS_PORT = 6379
|
REDIS_PORT=6379
|
||||||
|
|
||||||
PLUGINS_DIR = plugins
|
PLUGINS_DIR=plugins
|
||||||
PLUGINS_URL = null
|
PLUGINS_URL=
|
||||||
|
|
||||||
JWT_SECRET = 1tdM3gXarxYI4KlAHMBo238iC2tEb4I3EtBlZTQQXvInXIt7V2ix7hJ1KTvxCKZW
|
JWT_SECRET=1tdM3gXarxYI4KlAHMBo238iC2tEb4I3EtBlZTQQXvInXIt7V2ix7hJ1KTvxCKZW
|
||||||
|
|
|
||||||
|
|
@ -65,37 +65,37 @@ class SetupController extends Controller
|
||||||
$content = $filesystem->get(base_path('.env'));
|
$content = $filesystem->get(base_path('.env'));
|
||||||
$content = preg_replace(
|
$content = preg_replace(
|
||||||
'/DB_CONNECTION.+/',
|
'/DB_CONNECTION.+/',
|
||||||
'DB_CONNECTION = '.$request->input('type'),
|
'DB_CONNECTION='.$request->input('type', ''),
|
||||||
$content
|
$content
|
||||||
);
|
);
|
||||||
$content = preg_replace(
|
$content = preg_replace(
|
||||||
'/DB_HOST.+/',
|
'/DB_HOST.+/',
|
||||||
'DB_HOST = '.$request->input('host'),
|
'DB_HOST='.$request->input('host', ''),
|
||||||
$content
|
$content
|
||||||
);
|
);
|
||||||
$content = preg_replace(
|
$content = preg_replace(
|
||||||
'/DB_PORT.+/',
|
'/DB_PORT.+/',
|
||||||
'DB_PORT = '.$request->input('port'),
|
'DB_PORT='.$request->input('port', ''),
|
||||||
$content
|
$content
|
||||||
);
|
);
|
||||||
$content = preg_replace(
|
$content = preg_replace(
|
||||||
'/DB_DATABASE.+/',
|
'/DB_DATABASE.+/',
|
||||||
'DB_DATABASE = '.$request->input('db'),
|
'DB_DATABASE='.$request->input('db', ''),
|
||||||
$content
|
$content
|
||||||
);
|
);
|
||||||
$content = preg_replace(
|
$content = preg_replace(
|
||||||
'/DB_USERNAME.+/',
|
'/DB_USERNAME.+/',
|
||||||
'DB_USERNAME = '.$request->input('username'),
|
'DB_USERNAME='.$request->input('username', ''),
|
||||||
$content
|
$content
|
||||||
);
|
);
|
||||||
$content = preg_replace(
|
$content = preg_replace(
|
||||||
'/DB_PASSWORD.+/',
|
'/DB_PASSWORD.+/',
|
||||||
'DB_PASSWORD = '.$request->input('password'),
|
'DB_PASSWORD='.$request->input('password', ''),
|
||||||
$content
|
$content
|
||||||
);
|
);
|
||||||
$content = preg_replace(
|
$content = preg_replace(
|
||||||
'/DB_PREFIX.+/',
|
'/DB_PREFIX.+/',
|
||||||
'DB_PREFIX = '.$request->input('prefix'),
|
'DB_PREFIX='.$request->input('prefix', ''),
|
||||||
$content
|
$content
|
||||||
);
|
);
|
||||||
$filesystem->put(base_path('.env'), $content);
|
$filesystem->put(base_path('.env'), $content);
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,9 @@ class SetupControllerTest extends TestCase
|
||||||
$mock->shouldReceive('get')
|
$mock->shouldReceive('get')
|
||||||
->with(base_path('.env'))
|
->with(base_path('.env'))
|
||||||
->once()
|
->once()
|
||||||
->andReturn('DB_CONNECTION = abc');
|
->andReturn('DB_CONNECTION=abc');
|
||||||
$mock->shouldReceive('put')
|
$mock->shouldReceive('put')
|
||||||
->with(base_path('.env'), 'DB_CONNECTION = '.env('DB_CONNECTION'))
|
->with(base_path('.env'), 'DB_CONNECTION='.env('DB_CONNECTION'))
|
||||||
->once()
|
->once()
|
||||||
->andReturn(true);
|
->andReturn(true);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user