@@ -19,22 +19,22 @@ discard block |
||
19 | 19 | 'db' => [ |
20 | 20 | 'class' => \dmstr\console\controllers\MysqlController::class, |
21 | 21 | 'noDataTables' => [ |
22 | - getenv('DATABASE_TABLE_PREFIX') . 'auth_assignment', |
|
23 | - getenv('DATABASE_TABLE_PREFIX') . 'migration', |
|
24 | - getenv('DATABASE_TABLE_PREFIX') . 'user', |
|
25 | - getenv('DATABASE_TABLE_PREFIX') . 'profile', |
|
26 | - getenv('DATABASE_TABLE_PREFIX') . 'token', |
|
27 | - getenv('DATABASE_TABLE_PREFIX') . 'social_account', |
|
28 | - getenv('DATABASE_TABLE_PREFIX') . 'log', |
|
29 | - getenv('DATABASE_TABLE_PREFIX') . 'session', |
|
30 | - getenv('DATABASE_TABLE_PREFIX') . 'audit_data', |
|
31 | - getenv('DATABASE_TABLE_PREFIX') . 'audit_entry', |
|
32 | - getenv('DATABASE_TABLE_PREFIX') . 'audit_error', |
|
33 | - getenv('DATABASE_TABLE_PREFIX') . 'audit_javascript', |
|
34 | - getenv('DATABASE_TABLE_PREFIX') . 'audit_mail', |
|
35 | - getenv('DATABASE_TABLE_PREFIX') . 'audit_trail', |
|
36 | - getenv('DATABASE_TABLE_PREFIX') . 'dmstr_contact_log', |
|
37 | - getenv('DATABASE_TABLE_PREFIX') . 'queue_manager', |
|
22 | + getenv('DATABASE_TABLE_PREFIX').'auth_assignment', |
|
23 | + getenv('DATABASE_TABLE_PREFIX').'migration', |
|
24 | + getenv('DATABASE_TABLE_PREFIX').'user', |
|
25 | + getenv('DATABASE_TABLE_PREFIX').'profile', |
|
26 | + getenv('DATABASE_TABLE_PREFIX').'token', |
|
27 | + getenv('DATABASE_TABLE_PREFIX').'social_account', |
|
28 | + getenv('DATABASE_TABLE_PREFIX').'log', |
|
29 | + getenv('DATABASE_TABLE_PREFIX').'session', |
|
30 | + getenv('DATABASE_TABLE_PREFIX').'audit_data', |
|
31 | + getenv('DATABASE_TABLE_PREFIX').'audit_entry', |
|
32 | + getenv('DATABASE_TABLE_PREFIX').'audit_error', |
|
33 | + getenv('DATABASE_TABLE_PREFIX').'audit_javascript', |
|
34 | + getenv('DATABASE_TABLE_PREFIX').'audit_mail', |
|
35 | + getenv('DATABASE_TABLE_PREFIX').'audit_trail', |
|
36 | + getenv('DATABASE_TABLE_PREFIX').'dmstr_contact_log', |
|
37 | + getenv('DATABASE_TABLE_PREFIX').'queue_manager', |
|
38 | 38 | 'filefly_hashmap', # TODO: fix prefix in module |
39 | 39 | ], |
40 | 40 | ], |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | 'class' => \yii\log\FileTarget::class, |
77 | 77 | 'logFile' => '@runtime/logs/console.log', |
78 | 78 | //'levels' => ['info', 'trace'], |
79 | - 'logVars' => [], |
|
79 | + 'logVars' => [ ], |
|
80 | 80 | 'dirMode' => YII_ENV_DEV ? 0777 : 0775, |
81 | 81 | 'fileMode' => YII_ENV_DEV ? 0666 : null, |
82 | 82 | 'enabled' => YII_DEBUG && !YII_ENV_TEST, |
@@ -3,10 +3,10 @@ discard block |
||
3 | 3 | // Prepare environment |
4 | 4 | $rootPath = realpath(__DIR__.'/..'); |
5 | 5 | require($rootPath.'/vendor/autoload.php'); |
6 | -require($rootPath . '/config/env.php'); |
|
6 | +require($rootPath.'/config/env.php'); |
|
7 | 7 | |
8 | 8 | // Define framework & application constants |
9 | -defined('YII_DEBUG') or define('YII_DEBUG', (boolean)getenv('YII_DEBUG')); |
|
9 | +defined('YII_DEBUG') or define('YII_DEBUG', (boolean) getenv('YII_DEBUG')); |
|
10 | 10 | defined('YII_ENV') or define('YII_ENV', getenv('YII_ENV')); |
11 | 11 | defined('APP_TYPE') or define('APP_TYPE', 'web'); |
12 | 12 | |
@@ -22,4 +22,4 @@ discard block |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | // Run application |
25 | -(new yii\web\Application(require($rootPath . '/config/main.php')))->run(); |
|
25 | +(new yii\web\Application(require($rootPath.'/config/main.php')))->run(); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | public function safeUp() |
14 | 14 | { |
15 | 15 | $table = $this->db->schema->getTableSchema('{{%migration}}'); |
16 | - if (isset($table->columns['alias'])) { |
|
16 | + if (isset($table->columns[ 'alias' ])) { |
|
17 | 17 | // Column exists |
18 | 18 | $this->alterColumn('{{%migration}}', 'alias', 'varchar(180) DEFAULT NULL'); |
19 | 19 | } |
@@ -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 | ], |
@@ -197,9 +197,9 @@ discard block |
||
197 | 197 | 'user' => [ |
198 | 198 | 'class' => \dmstr\web\User::class, |
199 | 199 | 'enableAutoLogin' => true, |
200 | - 'loginUrl' => ['/user/security/login'], |
|
200 | + 'loginUrl' => [ '/user/security/login' ], |
|
201 | 201 | 'identityClass' => Da\User\Model\User::class, |
202 | - 'rootUsers' => ['admin'], |
|
202 | + 'rootUsers' => [ 'admin' ], |
|
203 | 203 | ], |
204 | 204 | 'urlManager' => [ |
205 | 205 | 'class' => \codemix\localeurls\UrlManager::class, |
@@ -230,16 +230,16 @@ discard block |
||
230 | 230 | 'auto_reload' => true, |
231 | 231 | ], |
232 | 232 | 'globals' => [ |
233 | - 'Html' => ['class' => \yii\helpers\Html::class], |
|
234 | - 'Json' => ['class' => \yii\helpers\Json::class], |
|
235 | - 'Tree' => ['class' => \dmstr\modules\pages\models\Tree::class], |
|
236 | - 'FA' => ['class' => \rmrevin\yii\fontawesome\FA::class], |
|
237 | - 'FileUrl' => ['class' => \hrzg\filemanager\helpers\Url::class], |
|
238 | - 'Url' => ['class' => \yii\helpers\Url::class], |
|
239 | - 'Markdown' => ['class' => \yii\helpers\Markdown::class], |
|
233 | + 'Html' => [ 'class' => \yii\helpers\Html::class ], |
|
234 | + 'Json' => [ 'class' => \yii\helpers\Json::class ], |
|
235 | + 'Tree' => [ 'class' => \dmstr\modules\pages\models\Tree::class ], |
|
236 | + 'FA' => [ 'class' => \rmrevin\yii\fontawesome\FA::class ], |
|
237 | + 'FileUrl' => [ 'class' => \hrzg\filemanager\helpers\Url::class ], |
|
238 | + 'Url' => [ 'class' => \yii\helpers\Url::class ], |
|
239 | + 'Markdown' => [ 'class' => \yii\helpers\Markdown::class ], |
|
240 | 240 | ], |
241 | 241 | 'functions' => [ |
242 | - 'image' => function ($imageSource, $preset = null) { |
|
242 | + 'image' => function($imageSource, $preset = null) { |
|
243 | 243 | // sanitize input |
244 | 244 | $preset = trim($preset, "/"); |
245 | 245 | $baseUrl = trim(Yii::$app->settings->get('imgBaseUrl', 'app.frontend'), "/"); |
@@ -251,15 +251,15 @@ discard block |
||
251 | 251 | // add HMAC sign key to preset when using imageproxy, see also https://github.com/willnorris/imageproxy#examples |
252 | 252 | if (getenv('IMAGEPROXY_SIGNATURE_KEY')) { |
253 | 253 | $key = getenv('IMAGEPROXY_SIGNATURE_KEY'); |
254 | - $preset .= ',s' . strtr( |
|
254 | + $preset .= ',s'.strtr( |
|
255 | 255 | base64_encode(hash_hmac('sha256', $remoteUrl, $key, 1)), |
256 | 256 | '/+', |
257 | 257 | '_-' |
258 | 258 | ); |
259 | 259 | } |
260 | - return implode('/', array_filter([$baseUrl,$preset,$remoteUrl])); |
|
260 | + return implode('/', array_filter([ $baseUrl, $preset, $remoteUrl ])); |
|
261 | 261 | }, |
262 | - 't' => function ($category, $message) { |
|
262 | + 't' => function($category, $message) { |
|
263 | 263 | return Yii::t($category, $message); |
264 | 264 | }, |
265 | 265 | ], |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | 'modules' => [ |
274 | 274 | 'audit' => [ |
275 | 275 | 'class' => \bedezign\yii2\audit\Audit::class, |
276 | - 'accessRoles' => ['audit-module'], |
|
276 | + 'accessRoles' => [ 'audit-module' ], |
|
277 | 277 | 'layout' => $boxLayout, |
278 | 278 | 'panels' => [ |
279 | 279 | 'audit/trail' => [ |
@@ -354,12 +354,12 @@ discard block |
||
354 | 354 | [ |
355 | 355 | 'connection' => 'db', |
356 | 356 | 'table' => '{{%hrzg_widget_template}}', |
357 | - 'columns' => ['twig_template'] |
|
357 | + 'columns' => [ 'twig_template' ] |
|
358 | 358 | ], |
359 | 359 | [ |
360 | 360 | 'connection' => 'db', |
361 | 361 | 'table' => '{{%twig}}', |
362 | - 'columns' => ['value'] |
|
362 | + 'columns' => [ 'value' ] |
|
363 | 363 | ] |
364 | 364 | ], |
365 | 365 | 'scanners' => [ |
@@ -368,15 +368,15 @@ discard block |
||
368 | 368 | ScannerJavaScriptFunction::class, |
369 | 369 | ScannerDatabase::class |
370 | 370 | ], |
371 | - 'allowedIPs' => ['*'], |
|
372 | - 'roles' => ['translate-module'], |
|
371 | + 'allowedIPs' => [ '*' ], |
|
372 | + 'roles' => [ 'translate-module' ], |
|
373 | 373 | ], |
374 | 374 | 'user' => [ |
375 | 375 | 'class' => Da\User\Module::class, |
376 | 376 | 'layout' => '@app/views/layouts/container', |
377 | 377 | 'defaultRoute' => 'admin', |
378 | 378 | 'administratorPermissionName' => 'user-module', |
379 | - 'administrators' => ['admin'], |
|
379 | + 'administrators' => [ 'admin' ], |
|
380 | 380 | 'enableFlashMessages' => false, |
381 | 381 | 'enableRegistration' => getenv('APP_USER_ENABLE_REGISTRATION'), |
382 | 382 | 'mailParams' => [ |
@@ -32,13 +32,13 @@ |
||
32 | 32 | $dotenv->required('YII_DEBUG', ['', '0', '1', 'true', true]); |
33 | 33 | $dotenv->required('YII_ENV', ['dev', 'prod', 'test']); |
34 | 34 | $dotenv->required([ |
35 | - 'YII_TRACE_LEVEL', |
|
36 | - 'APP_NAME', |
|
37 | - 'APP_TITLE', |
|
38 | - 'APP_ADMIN_EMAIL', |
|
39 | - 'APP_LANGUAGES', |
|
40 | - 'APP_COOKIE_VALIDATION_KEY', |
|
41 | - ])->notEmpty(); |
|
35 | + 'YII_TRACE_LEVEL', |
|
36 | + 'APP_NAME', |
|
37 | + 'APP_TITLE', |
|
38 | + 'APP_ADMIN_EMAIL', |
|
39 | + 'APP_LANGUAGES', |
|
40 | + 'APP_COOKIE_VALIDATION_KEY', |
|
41 | + ])->notEmpty(); |
|
42 | 42 | |
43 | 43 | // Additional validations |
44 | 44 | if (!preg_match('/^[a-z0-9_-]{2,16}$/', getenv('APP_NAME'))) { |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | |
16 | 16 | // Load default settings via dotenv from file, load local environment first, if available |
17 | 17 | if (getenv('ENV_LOCAL_FILE')) { |
18 | - $localEnv = FileHelper::normalizePath($configPath . '/' . getenv('ENV_LOCAL_FILE')); |
|
18 | + $localEnv = FileHelper::normalizePath($configPath.'/'.getenv('ENV_LOCAL_FILE')); |
|
19 | 19 | if (is_file($localEnv)) { |
20 | 20 | $dotenvLocal = new Dotenv\Dotenv($configPath, getenv('ENV_LOCAL_FILE')); |
21 | 21 | $dotenvLocal->load(); |
22 | 22 | } else { |
23 | - exit("Error: ENV_LOCAL_FILE '{$localEnv}' not found" . PHP_EOL); |
|
23 | + exit("Error: ENV_LOCAL_FILE '{$localEnv}' not found".PHP_EOL); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | $dotenv->load(); |
30 | 30 | |
31 | 31 | // Basic checks & validation |
32 | -$dotenv->required('YII_DEBUG', ['', '0', '1', 'true', true]); |
|
33 | -$dotenv->required('YII_ENV', ['dev', 'prod', 'test']); |
|
32 | +$dotenv->required('YII_DEBUG', [ '', '0', '1', 'true', true ]); |
|
33 | +$dotenv->required('YII_ENV', [ 'dev', 'prod', 'test' ]); |
|
34 | 34 | $dotenv->required([ |
35 | 35 | 'YII_TRACE_LEVEL', |
36 | 36 | 'APP_NAME', |
@@ -65,20 +65,20 @@ |
||
65 | 65 | <?php $this->beginBody() ?> |
66 | 66 | |
67 | 67 | <?php Pjax::begin([ |
68 | - 'id' => 'main-content', |
|
69 | - 'timeout' => 5000, |
|
70 | - 'linkSelector' => '.frontend-reload', |
|
71 | - ]) ?> |
|
68 | + 'id' => 'main-content', |
|
69 | + 'timeout' => 5000, |
|
70 | + 'linkSelector' => '.frontend-reload', |
|
71 | + ]) ?> |
|
72 | 72 | |
73 | 73 | <?= TwigWidget::widget(['key' => '_beginBody', 'renderEmpty' => false]) ?> |
74 | 74 | |
75 | 75 | <!-- Navbar --> |
76 | 76 | <?php |
77 | 77 | if (Yii::$app->settings->get('enableTwigNavbar', 'app.layout', false)) { |
78 | - echo \dmstr\modules\prototype\widgets\TwigWidget::widget(['key' => '_navbar']); |
|
79 | - } else { |
|
80 | - echo $this->render('_navbar'); |
|
81 | - } |
|
78 | + echo \dmstr\modules\prototype\widgets\TwigWidget::widget(['key' => '_navbar']); |
|
79 | + } else { |
|
80 | + echo $this->render('_navbar'); |
|
81 | + } |
|
82 | 82 | |
83 | 83 | ?> |
84 | 84 |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | /* @var $this \yii\web\View */ |
24 | 24 | /* @var $content string */ |
25 | 25 | |
26 | -$this->title .= ' - ' . getenv('APP_TITLE'); |
|
27 | -$this->title = (getenv('APP_PAGES_TITLE_PREFIX') ?? '') . $this->title; |
|
26 | +$this->title .= ' - '.getenv('APP_TITLE'); |
|
27 | +$this->title = (getenv('APP_PAGES_TITLE_PREFIX') ?? '').$this->title; |
|
28 | 28 | |
29 | 29 | SettingsAsset::register($this); |
30 | 30 | |
@@ -32,18 +32,18 @@ discard block |
||
32 | 32 | \yii\base\Event::on( |
33 | 33 | \yii\web\View::className(), |
34 | 34 | \yii\web\View::EVENT_AFTER_RENDER, |
35 | - function ($e) { |
|
35 | + function($e) { |
|
36 | 36 | // disable unbundled asset |
37 | - $e->sender->assetBundles['yii\\bootstrap\\BootstrapAsset'] = null; |
|
37 | + $e->sender->assetBundles[ 'yii\\bootstrap\\BootstrapAsset' ] = null; |
|
38 | 38 | // disable bundled asset |
39 | - $e->sender->assetBundles['bootstrap'] = null; |
|
39 | + $e->sender->assetBundles[ 'bootstrap' ] = null; |
|
40 | 40 | } |
41 | 41 | ); |
42 | 42 | } |
43 | 43 | |
44 | 44 | // Favicon |
45 | 45 | if ($favicon = \Yii::$app->settings->get('faviconPng', 'app.assets', null)) { |
46 | - $this->registerLinkTag(['rel' => 'shortcut icon', 'type' => 'image/png', 'href' => $favicon]); |
|
46 | + $this->registerLinkTag([ 'rel' => 'shortcut icon', 'type' => 'image/png', 'href' => $favicon ]); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | ?> |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | 'linkSelector' => '.frontend-reload', |
71 | 71 | ]) ?> |
72 | 72 | |
73 | -<?= TwigWidget::widget(['key' => '_beginBody', 'renderEmpty' => false]) ?> |
|
73 | +<?= TwigWidget::widget([ 'key' => '_beginBody', 'renderEmpty' => false ]) ?> |
|
74 | 74 | |
75 | 75 | <!-- Navbar --> |
76 | 76 | <?php |
77 | 77 | if (Yii::$app->settings->get('enableTwigNavbar', 'app.layout', false)) { |
78 | - echo \dmstr\modules\prototype\widgets\TwigWidget::widget(['key' => '_navbar']); |
|
78 | + echo \dmstr\modules\prototype\widgets\TwigWidget::widget([ 'key' => '_navbar' ]); |
|
79 | 79 | } else { |
80 | 80 | echo $this->render('_navbar'); |
81 | 81 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | <!-- Footer --> |
93 | 93 | <footer class="footer"> |
94 | - <?= Cell::widget(['id' => '_footer', 'requestParam' => '_global']) ?> |
|
94 | + <?= Cell::widget([ 'id' => '_footer', 'requestParam' => '_global' ]) ?> |
|
95 | 95 | </footer> |
96 | 96 | |
97 | 97 | <?php Pjax::end() ?> |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | ], |
107 | 107 | ]) ?> |
108 | 108 | |
109 | -<?= TwigWidget::widget(['key' => '_endBody', 'renderEmpty' => false]) ?> |
|
109 | +<?= TwigWidget::widget([ 'key' => '_endBody', 'renderEmpty' => false ]) ?> |
|
110 | 110 | |
111 | 111 | <?php if (Yii::$app->user->can('backend_default_index')): ?> |
112 | 112 |