@@ -20,10 +20,10 @@ discard block |
||
20 | 20 | $languages = explode(',', getenv('APP_LANGUAGES')); |
21 | 21 | |
22 | 22 | // prepare asset bundle config |
23 | -$bundles = []; |
|
23 | +$bundles = [ ]; |
|
24 | 24 | if (getenv('APP_ASSET_USE_BUNDLED')) { |
25 | 25 | // include generated asset-bundle configuration |
26 | - $bundles = include Yii::getAlias('@web/bundles') . '/config.php'; |
|
26 | + $bundles = include Yii::getAlias('@web/bundles').'/config.php'; |
|
27 | 27 | // disable loading of bundles skin file, when using bundled assets |
28 | 28 | Yii::$container->set( |
29 | 29 | AdminLteAsset::className(), |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | return [ |
66 | 66 | 'id' => 'app', |
67 | 67 | 'name' => getenv('APP_TITLE'), |
68 | - 'language' => $languages[0], |
|
68 | + 'language' => $languages[ 0 ], |
|
69 | 69 | 'basePath' => '@app', |
70 | 70 | 'vendorPath' => '@root/vendor', |
71 | 71 | 'runtimePath' => '@root/runtime', |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | ], |
84 | 84 | 'params' => [ |
85 | 85 | 'adminEmail' => getenv('APP_ADMIN_EMAIL'), |
86 | - 'context.menuItems' => [], |
|
86 | + 'context.menuItems' => [ ], |
|
87 | 87 | 'backend.iframe.name' => getenv('APP_PARAMS_BACKEND_IFRAME_NAME') ?: '_self', |
88 | 88 | 'backend.browserSupport' => [ |
89 | 89 | 'Chrome' => 72, |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | ], |
109 | 109 | 'authManager' => [ |
110 | 110 | 'class' => \yii\rbac\DbManager::class, |
111 | - 'defaultRoles' => ['Default'], |
|
111 | + 'defaultRoles' => [ 'Default' ], |
|
112 | 112 | 'cache' => 'cache' |
113 | 113 | ], |
114 | 114 | 'cache' => |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | 'key' => getenv('AMAZON_S3_BUCKET_PUBLIC_KEY'), |
135 | 135 | 'secret' => getenv('AMAZON_S3_BUCKET_SECRET_KEY'), |
136 | 136 | 'bucket' => getenv('AMAZON_S3_BUCKET_NAME'), |
137 | - 'prefix' => getenv('APP_NAME') . '/public', |
|
137 | + 'prefix' => getenv('APP_NAME').'/public', |
|
138 | 138 | 'region' => getenv('AMAZON_S3_BUCKET_REGION'), |
139 | 139 | ], |
140 | 140 | 'fsRuntime' => [ |
@@ -160,8 +160,8 @@ discard block |
||
160 | 160 | 'common' => [ |
161 | 161 | 'class' => \codemix\streamlog\Target::class, |
162 | 162 | 'url' => 'php://stderr', |
163 | - 'levels' => ['error', 'warning'], |
|
164 | - 'logVars' => [], |
|
163 | + 'levels' => [ 'error', 'warning' ], |
|
164 | + 'logVars' => [ ], |
|
165 | 165 | 'replaceNewline' => (APP_TYPE == 'console') ? null : '', |
166 | 166 | ], |
167 | 167 | ], |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | 'messageConfig' => [ |
183 | 183 | 'charset' => 'UTF-8', |
184 | 184 | 'returnPath' => getenv('APP_MAILER_RETURN_PATH'), |
185 | - 'from' => [getenv('APP_MAILER_FROM') => getenv('APP_TITLE')], |
|
185 | + 'from' => [ getenv('APP_MAILER_FROM') => getenv('APP_TITLE') ], |
|
186 | 186 | ], |
187 | 187 | ], |
188 | 188 | 'queue' => [ |
@@ -204,9 +204,9 @@ discard block |
||
204 | 204 | 'user' => [ |
205 | 205 | 'class' => \dmstr\web\User::class, |
206 | 206 | 'enableAutoLogin' => true, |
207 | - 'loginUrl' => ['/user/security/login'], |
|
207 | + 'loginUrl' => [ '/user/security/login' ], |
|
208 | 208 | 'identityClass' => Da\User\Model\User::class, |
209 | - 'rootUsers' => ['admin'], |
|
209 | + 'rootUsers' => [ 'admin' ], |
|
210 | 210 | ], |
211 | 211 | 'urlManager' => [ |
212 | 212 | 'class' => \codemix\localeurls\UrlManager::class, |
@@ -237,16 +237,16 @@ discard block |
||
237 | 237 | 'auto_reload' => true, |
238 | 238 | ], |
239 | 239 | 'globals' => [ |
240 | - 'Html' => ['class' => \yii\helpers\Html::class], |
|
241 | - 'Json' => ['class' => \yii\helpers\Json::class], |
|
242 | - 'Tree' => ['class' => \dmstr\modules\pages\models\Tree::class], |
|
243 | - 'FA' => ['class' => \rmrevin\yii\fontawesome\FA::class], |
|
244 | - 'FileUrl' => ['class' => \hrzg\filemanager\helpers\Url::class], |
|
245 | - 'Url' => ['class' => \yii\helpers\Url::class], |
|
246 | - 'Markdown' => ['class' => \yii\helpers\Markdown::class], |
|
240 | + 'Html' => [ 'class' => \yii\helpers\Html::class ], |
|
241 | + 'Json' => [ 'class' => \yii\helpers\Json::class ], |
|
242 | + 'Tree' => [ 'class' => \dmstr\modules\pages\models\Tree::class ], |
|
243 | + 'FA' => [ 'class' => \rmrevin\yii\fontawesome\FA::class ], |
|
244 | + 'FileUrl' => [ 'class' => \hrzg\filemanager\helpers\Url::class ], |
|
245 | + 'Url' => [ 'class' => \yii\helpers\Url::class ], |
|
246 | + 'Markdown' => [ 'class' => \yii\helpers\Markdown::class ], |
|
247 | 247 | ], |
248 | 248 | 'functions' => [ |
249 | - 'image' => function ($imageSource, $preset = null) { |
|
249 | + 'image' => function($imageSource, $preset = null) { |
|
250 | 250 | // sanitize input |
251 | 251 | $preset = trim($preset, "/"); |
252 | 252 | $baseUrl = trim(Yii::$app->settings->get('imgBaseUrl', 'app.frontend'), "/"); |
@@ -258,15 +258,15 @@ discard block |
||
258 | 258 | // add HMAC sign key to preset when using imageproxy, see also https://github.com/willnorris/imageproxy#examples |
259 | 259 | if (getenv('IMAGEPROXY_SIGNATURE_KEY')) { |
260 | 260 | $key = getenv('IMAGEPROXY_SIGNATURE_KEY'); |
261 | - $preset .= ',s' . strtr( |
|
261 | + $preset .= ',s'.strtr( |
|
262 | 262 | base64_encode(hash_hmac('sha256', $remoteUrl, $key, 1)), |
263 | 263 | '/+', |
264 | 264 | '_-' |
265 | 265 | ); |
266 | 266 | } |
267 | - return implode('/', array_filter([$baseUrl,$preset,$remoteUrl])); |
|
267 | + return implode('/', array_filter([ $baseUrl, $preset, $remoteUrl ])); |
|
268 | 268 | }, |
269 | - 't' => function ($category, $message) { |
|
269 | + 't' => function($category, $message) { |
|
270 | 270 | return Yii::t($category, $message); |
271 | 271 | }, |
272 | 272 | ], |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | 'modules' => [ |
281 | 281 | 'audit' => [ |
282 | 282 | 'class' => \bedezign\yii2\audit\Audit::class, |
283 | - 'accessRoles' => ['audit-module'], |
|
283 | + 'accessRoles' => [ 'audit-module' ], |
|
284 | 284 | 'layout' => $boxLayout, |
285 | 285 | 'panels' => [ |
286 | 286 | 'audit/trail' => [ |
@@ -364,12 +364,12 @@ discard block |
||
364 | 364 | [ |
365 | 365 | 'connection' => 'db', |
366 | 366 | 'table' => '{{%hrzg_widget_template}}', |
367 | - 'columns' => ['twig_template'] |
|
367 | + 'columns' => [ 'twig_template' ] |
|
368 | 368 | ], |
369 | 369 | [ |
370 | 370 | 'connection' => 'db', |
371 | 371 | 'table' => '{{%twig}}', |
372 | - 'columns' => ['value'] |
|
372 | + 'columns' => [ 'value' ] |
|
373 | 373 | ] |
374 | 374 | ], |
375 | 375 | 'scanners' => [ |
@@ -378,15 +378,15 @@ discard block |
||
378 | 378 | ScannerJavaScriptFunction::class, |
379 | 379 | ScannerDatabase::class |
380 | 380 | ], |
381 | - 'allowedIPs' => ['*'], |
|
382 | - 'roles' => ['translate-module'], |
|
381 | + 'allowedIPs' => [ '*' ], |
|
382 | + 'roles' => [ 'translate-module' ], |
|
383 | 383 | ], |
384 | 384 | 'user' => [ |
385 | 385 | 'class' => Da\User\Module::class, |
386 | 386 | 'layout' => '@app/views/layouts/container', |
387 | 387 | 'defaultRoute' => 'admin', |
388 | 388 | 'administratorPermissionName' => 'user-module', |
389 | - 'administrators' => ['admin'], |
|
389 | + 'administrators' => [ 'admin' ], |
|
390 | 390 | 'enableFlashMessages' => false, |
391 | 391 | 'enableRegistration' => getenv('APP_USER_ENABLE_REGISTRATION'), |
392 | 392 | 'mailParams' => [ |
@@ -28,14 +28,14 @@ discard block |
||
28 | 28 | public function actionConfig($key = null) |
29 | 29 | { |
30 | 30 | // get config from global variable (TODO) |
31 | - $data = $GLOBALS['config']; |
|
31 | + $data = $GLOBALS[ 'config' ]; |
|
32 | 32 | if ($key) { |
33 | 33 | $keys = explode('.', $key); |
34 | - if (isset($keys[0])) { |
|
35 | - $data = $GLOBALS['config'][$keys[0]]; |
|
34 | + if (isset($keys[ 0 ])) { |
|
35 | + $data = $GLOBALS[ 'config' ][ $keys[ 0 ] ]; |
|
36 | 36 | } |
37 | - if (isset($keys[1])) { |
|
38 | - $data = $GLOBALS['config'][$keys[0]][$keys[1]]; |
|
37 | + if (isset($keys[ 1 ])) { |
|
38 | + $data = $GLOBALS[ 'config' ][ $keys[ 0 ] ][ $keys[ 1 ] ]; |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | $this->stdout(VarDumper::dumpAsString($data)); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | public function actionVersion() |
58 | 58 | { |
59 | 59 | $this->stdout('Application Version: '); |
60 | - $this->stdout(getenv('APP_NAME') . ' '); |
|
60 | + $this->stdout(getenv('APP_NAME').' '); |
|
61 | 61 | $this->stdout(APP_VERSION); |
62 | 62 | echo "\n"; |
63 | 63 | } |
@@ -72,12 +72,12 @@ discard block |
||
72 | 72 | $this->stdout("=====================\n"); |
73 | 73 | $this->stdout("Initializing application\n"); |
74 | 74 | |
75 | - $this->interactive = (bool)getenv('APP_INTERACTIVE'); |
|
75 | + $this->interactive = (bool) getenv('APP_INTERACTIVE'); |
|
76 | 76 | |
77 | 77 | $this->stdout("\nDatabase\n"); |
78 | 78 | $this->stdout("--------\n"); |
79 | 79 | $this->run('db/create'); |
80 | - $this->run('migrate/up', ['interactive' => (bool)getenv('APP_INTERACTIVE')]); |
|
80 | + $this->run('migrate/up', [ 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
81 | 81 | |
82 | 82 | $this->stdout("\nUser\n"); |
83 | 83 | $this->stdout("----\n"); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | 'default' => getenv('APP_ADMIN_PASSWORD') ?: \Yii::$app->security->generateRandomString(8), |
88 | 88 | ] |
89 | 89 | ); |
90 | - $this->run('user/create', [getenv('APP_ADMIN_EMAIL'), 'admin', $adminPassword]); |
|
90 | + $this->run('user/create', [ getenv('APP_ADMIN_EMAIL'), 'admin', $adminPassword ]); |
|
91 | 91 | |
92 | 92 | $this->stdout('Initializing modules'); |
93 | 93 | |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | $this->stdout("\nCleanup\n"); |
103 | 103 | $this->stdout("-------\n"); |
104 | 104 | $this->run('cache/flush-all'); |
105 | - $this->run('audit/cleanup', ['age' => 30, 'interactive' => (bool)getenv('APP_INTERACTIVE')]); |
|
106 | - $this->run('app/clear-assets', ['interactive' => (bool)getenv('APP_INTERACTIVE')]); |
|
105 | + $this->run('audit/cleanup', [ 'age' => 30, 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
106 | + $this->run('app/clear-assets', [ 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -117,20 +117,20 @@ discard block |
||
117 | 117 | $matchRegex = '"^[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]\?[a-z0-9]$"'; |
118 | 118 | |
119 | 119 | // create $cmd command |
120 | - $cmd = 'cd "' . $assets . '" && ls | grep -e ' . $matchRegex . ' | xargs rm -rf '; |
|
120 | + $cmd = 'cd "'.$assets.'" && ls | grep -e '.$matchRegex.' | xargs rm -rf '; |
|
121 | 121 | |
122 | 122 | // Set command |
123 | 123 | $command = new Command($cmd); |
124 | 124 | |
125 | 125 | // Prompt user |
126 | - $delete = $this->confirm("\nDo you really want to delete web assets?", ['default' => true]); |
|
126 | + $delete = $this->confirm("\nDo you really want to delete web assets?", [ 'default' => true ]); |
|
127 | 127 | |
128 | 128 | if ($delete) { |
129 | 129 | // Try to execute $command |
130 | 130 | if ($command->execute()) { |
131 | 131 | echo "Web assets have been deleted.\n\n"; |
132 | 132 | } else { |
133 | - echo "\n" . $command->getError() . "\n"; |
|
133 | + echo "\n".$command->getError()."\n"; |
|
134 | 134 | echo $command->getStdErr(); |
135 | 135 | } |
136 | 136 | } |
@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | $message = $mailer->compose(); |
144 | 144 | $message |
145 | 145 | ->setTo($to) |
146 | - ->setSubject('Test-Mail from ' . getenv('APP_NAME')) |
|
147 | - ->setTextBody(getenv('APP_TITLE') . ' | ' . getenv('HOSTNAME')); |
|
146 | + ->setSubject('Test-Mail from '.getenv('APP_NAME')) |
|
147 | + ->setTextBody(getenv('APP_TITLE').' | '.getenv('HOSTNAME')); |
|
148 | 148 | |
149 | 149 | if ($message->send()) { |
150 | 150 | $this->stdout('Mail sent'); |