Skip to content

Commit 60531f8

Browse files
committed
improve env/config
1 parent 2bd035c commit 60531f8

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.env.example

+5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
APP_ID=app
2+
APP_NAME=Application
3+
APP_LANGUAGE=uk-UA
4+
15
DB_DRIVER=mysql
26
DB_HOST=localhost
37
DB_NAME=dbname
48
DB_USER=user
59
DB_PASS=password
10+
611
YII_DEBUG=true
712
YII_ENV=dev
813
YII_MAIL_USE_FILE_TRANSPORT=true

src/config/console.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
$bootstrap = require(__DIR__ . '/bootstrap.php');
77

88
return [
9-
'id' => 'console-app',
9+
'id' => getenv('APP_ID') ? getenv('APP_ID') . '-cli' : 'app-cli',
10+
'name' => getenv('APP_NAME') ? getenv('APP_NAME') . '-CLI' : 'ApplicationCLI',
11+
'language' => getenv('APP_LANGUAGE'),
1012
'basePath' => dirname(__DIR__),
1113
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
1214
'runtimePath' => dirname(dirname(__DIR__)) . '/runtime',

src/config/web.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
$bootstrap = require(__DIR__ . '/bootstrap.php');
77

88
$config = [
9-
'id' => 'app',
10-
'name' => 'Application',
9+
'id' => getenv('APP_ID') ? getenv('APP_ID') : 'app',
10+
'name' => getenv('APP_NAME') ? getenv('APP_NAME') : 'Application',
11+
'language' => getenv('APP_LANGUAGE'),
1112
'basePath' => dirname(__DIR__),
1213
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
1314
'runtimePath' => dirname(dirname(__DIR__)) . '/runtime',

0 commit comments

Comments
 (0)