@@ -27,14 +27,14 @@ discard block |
||
| 27 | 27 | public function actionConfig($key = null) |
| 28 | 28 | { |
| 29 | 29 | // get config from global variable (TODO) |
| 30 | - $data = $GLOBALS['config']; |
|
| 30 | + $data = $GLOBALS[ 'config' ]; |
|
| 31 | 31 | if ($key) { |
| 32 | 32 | $keys = explode('.', $key); |
| 33 | - if (isset($keys[0])) { |
|
| 34 | - $data = $GLOBALS['config'][$keys[0]]; |
|
| 33 | + if (isset($keys[ 0 ])) { |
|
| 34 | + $data = $GLOBALS[ 'config' ][ $keys[ 0 ] ]; |
|
| 35 | 35 | } |
| 36 | - if (isset($keys[1])) { |
|
| 37 | - $data = $GLOBALS['config'][$keys[0]][$keys[1]]; |
|
| 36 | + if (isset($keys[ 1 ])) { |
|
| 37 | + $data = $GLOBALS[ 'config' ][ $keys[ 0 ] ][ $keys[ 1 ] ]; |
|
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | $this->stdout(VarDumper::dumpAsString($data)); |
@@ -76,13 +76,13 @@ discard block |
||
| 76 | 76 | $this->stdout("\nDatabase\n"); |
| 77 | 77 | $this->stdout("--------\n"); |
| 78 | 78 | $this->run('db/create'); |
| 79 | - $this->run('migrate/up', ['interactive' => (bool) getenv('APP_INTERACTIVE')]); |
|
| 79 | + $this->run('migrate/up', [ 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
| 80 | 80 | |
| 81 | 81 | $this->stdout("\nCleanup\n"); |
| 82 | 82 | $this->stdout("-------\n"); |
| 83 | 83 | $this->run('cache/flush-all'); |
| 84 | - $this->run('audit/cleanup', ['age' => 30, 'interactive' => (bool) getenv('APP_INTERACTIVE')]); |
|
| 85 | - $this->run('app/clear-assets', ['interactive' => (bool) getenv('APP_INTERACTIVE')]); |
|
| 84 | + $this->run('audit/cleanup', [ 'age' => 30, 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
| 85 | + $this->run('app/clear-assets', [ 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
| 86 | 86 | |
| 87 | 87 | $this->stdout("\nUser\n"); |
| 88 | 88 | $this->stdout("----\n"); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | 'default' => getenv('APP_ADMIN_PASSWORD') ?: \Yii::$app->security->generateRandomString(8), |
| 93 | 93 | ] |
| 94 | 94 | ); |
| 95 | - $this->run('user/create', [getenv('APP_ADMIN_EMAIL'), 'admin', $adminPassword]); |
|
| 95 | + $this->run('user/create', [ getenv('APP_ADMIN_EMAIL'), 'admin', $adminPassword ]); |
|
| 96 | 96 | |
| 97 | 97 | $this->stdout("\n\nDone.\n"); |
| 98 | 98 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $command = new Command($cmd); |
| 115 | 115 | |
| 116 | 116 | // Prompt user |
| 117 | - $delete = $this->confirm("\nDo you really want to delete web assets?", ['default' => true]); |
|
| 117 | + $delete = $this->confirm("\nDo you really want to delete web assets?", [ 'default' => true ]); |
|
| 118 | 118 | |
| 119 | 119 | if ($delete) { |
| 120 | 120 | // Try to execute $command |
@@ -13,13 +13,13 @@ discard block |
||
| 13 | 13 | $languages = explode(',', getenv('APP_LANGUAGES')); |
| 14 | 14 | |
| 15 | 15 | // prepare asset bundle config |
| 16 | -$bundles = []; |
|
| 16 | +$bundles = [ ]; |
|
| 17 | 17 | if (getenv('APP_ASSET_USE_BUNDLED')) { |
| 18 | 18 | $bundles = include Yii::getAlias('@web/bundles').'/config.php'; |
| 19 | 19 | } |
| 20 | 20 | if (getenv('APP_ASSET_DISABLE_BOOTSTRAP_BUNDLE')) { |
| 21 | - $bundles['yii\bootstrap\BootstrapAsset'] = [ |
|
| 22 | - 'css' => [], |
|
| 21 | + $bundles[ 'yii\bootstrap\BootstrapAsset' ] = [ |
|
| 22 | + 'css' => [ ], |
|
| 23 | 23 | ]; |
| 24 | 24 | } |
| 25 | 25 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | // Basic configuration, used in web and console applications |
| 41 | 41 | return [ |
| 42 | 42 | 'id' => 'app', |
| 43 | - 'language' => $languages[0], |
|
| 43 | + 'language' => $languages[ 0 ], |
|
| 44 | 44 | 'basePath' => realpath(__DIR__.'/..'), |
| 45 | 45 | 'vendorPath' => '@app/../vendor', |
| 46 | 46 | 'runtimePath' => '@app/../runtime', |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | ], |
| 55 | 55 | 'params' => [ |
| 56 | 56 | 'adminEmail' => getenv('APP_ADMIN_EMAIL'), |
| 57 | - 'context.menuItems' => [], |
|
| 57 | + 'context.menuItems' => [ ], |
|
| 58 | 58 | 'yii.migrations' => [ |
| 59 | 59 | getenv('APP_MIGRATION_LOOKUP'), |
| 60 | 60 | '@yii/rbac/migrations', |
@@ -72,8 +72,7 @@ discard block |
||
| 72 | 72 | 'dirMode' => 0775, |
| 73 | 73 | // Hashing for distributed systems |
| 74 | 74 | 'hashCallback' => YII_ENV_DEV ? |
| 75 | - null : |
|
| 76 | - function ($path) { |
|
| 75 | + null : function($path) { |
|
| 77 | 76 | return YII_ENV.'-'.substr(hash('sha256', $path), 0, 8).'-'.APP_VERSION.'-'.\Yii::$app->cache->get('prototype.less.changed_at'); |
| 78 | 77 | }, |
| 79 | 78 | // Note: You need to bundle asset with `yii asset` for development/debugging |
@@ -82,7 +81,7 @@ discard block |
||
| 82 | 81 | ], |
| 83 | 82 | 'authManager' => [ |
| 84 | 83 | 'class' => 'dektrium\rbac\components\DbManager', |
| 85 | - 'defaultRoles' => ['Default'], |
|
| 84 | + 'defaultRoles' => [ 'Default' ], |
|
| 86 | 85 | ], |
| 87 | 86 | 'cache' => [ |
| 88 | 87 | 'class' => 'yii\redis\Cache', |
@@ -126,8 +125,8 @@ discard block |
||
| 126 | 125 | [ |
| 127 | 126 | 'class' => 'codemix\streamlog\Target', |
| 128 | 127 | 'url' => 'php://stderr', |
| 129 | - 'levels' => ['error', 'warning'], |
|
| 130 | - 'logVars' => [], |
|
| 128 | + 'levels' => [ 'error', 'warning' ], |
|
| 129 | + 'logVars' => [ ], |
|
| 131 | 130 | 'replaceNewline' => '' |
| 132 | 131 | ], |
| 133 | 132 | ], |
@@ -157,9 +156,9 @@ discard block |
||
| 157 | 156 | 'user' => [ |
| 158 | 157 | 'class' => 'dmstr\web\User', |
| 159 | 158 | 'enableAutoLogin' => true, |
| 160 | - 'loginUrl' => ['/user/security/login'], |
|
| 159 | + 'loginUrl' => [ '/user/security/login' ], |
|
| 161 | 160 | 'identityClass' => 'dektrium\user\models\User', |
| 162 | - 'rootUsers' => ['admin'], |
|
| 161 | + 'rootUsers' => [ 'admin' ], |
|
| 163 | 162 | ], |
| 164 | 163 | 'urlManager' => [ |
| 165 | 164 | 'class' => 'codemix\localeurls\UrlManager', |
@@ -167,7 +166,7 @@ discard block |
||
| 167 | 166 | 'showScriptName' => false, |
| 168 | 167 | 'enableDefaultLanguageUrlCode' => true, |
| 169 | 168 | 'baseUrl' => '/', |
| 170 | - 'rules' => [], |
|
| 169 | + 'rules' => [ ], |
|
| 171 | 170 | 'ignoreLanguageUrlPatterns' => [ |
| 172 | 171 | // route pattern => url pattern |
| 173 | 172 | '#^filefly/api#' => '#^filefly/api#', |
@@ -205,15 +204,15 @@ discard block |
||
| 205 | 204 | 'audit/trail', |
| 206 | 205 | 'audit/javascript', # enable app.assets.registerJSLoggingAsset via settings |
| 207 | 206 | // These provide special functionality and get loaded to activate it |
| 208 | - 'audit/error', // Links the extra error reporting functions (`exception()` and `errorMessage()`) |
|
| 209 | - 'audit/extra', // Links the data functions (`data()`) |
|
| 210 | - 'audit/curl', // Links the curl tracking function (`curlBegin()`, `curlEnd()` and `curlExec()`) |
|
| 207 | + 'audit/error', // Links the extra error reporting functions (`exception()` and `errorMessage()`) |
|
| 208 | + 'audit/extra', // Links the data functions (`data()`) |
|
| 209 | + 'audit/curl', // Links the curl tracking function (`curlBegin()`, `curlEnd()` and `curlExec()`) |
|
| 211 | 210 | //'audit/db', |
| 212 | 211 | //'audit/log', |
| 213 | 212 | //'audit/profiling', |
| 214 | 213 | ], |
| 215 | 214 | 'ignoreActions' => [ |
| 216 | - (getenv('APP_AUDIT_DISABLE_ALL_ACTIONS') ? '*':'_'), |
|
| 215 | + (getenv('APP_AUDIT_DISABLE_ALL_ACTIONS') ? '*' : '_'), |
|
| 217 | 216 | 'audit/*', |
| 218 | 217 | 'help/*', |
| 219 | 218 | 'gii/*', |
@@ -263,8 +262,8 @@ discard block |
||
| 263 | 262 | 'class' => 'lajax\translatemanager\Module', |
| 264 | 263 | 'root' => '@app/views', |
| 265 | 264 | 'layout' => '@backend/views/layouts/box', |
| 266 | - 'allowedIPs' => ['*'], |
|
| 267 | - 'roles' => ['translate-module'], |
|
| 265 | + 'allowedIPs' => [ '*' ], |
|
| 266 | + 'roles' => [ 'translate-module' ], |
|
| 268 | 267 | ], |
| 269 | 268 | 'user' => [ |
| 270 | 269 | 'class' => 'dektrium\user\Module', |
@@ -11,9 +11,9 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | // Settings for web-application only |
| 13 | 13 | return [ |
| 14 | - 'on registerMenuItems' => function ($event) { |
|
| 15 | - Yii::$app->params['context.menuItems'] = \yii\helpers\ArrayHelper::merge( |
|
| 16 | - Yii::$app->params['context.menuItems'], |
|
| 14 | + 'on registerMenuItems' => function($event) { |
|
| 15 | + Yii::$app->params[ 'context.menuItems' ] = \yii\helpers\ArrayHelper::merge( |
|
| 16 | + Yii::$app->params[ 'context.menuItems' ], |
|
| 17 | 17 | $event->sender->getMenuItems() |
| 18 | 18 | ); |
| 19 | 19 | $event->handled = true; |
@@ -29,8 +29,8 @@ discard block |
||
| 29 | 29 | [ |
| 30 | 30 | 'class' => 'codemix\streamlog\Target', |
| 31 | 31 | 'url' => 'php://stdout', |
| 32 | - 'levels' => ['info', 'trace'], |
|
| 33 | - 'logVars' => [], |
|
| 32 | + 'levels' => [ 'info', 'trace' ], |
|
| 33 | + 'logVars' => [ ], |
|
| 34 | 34 | 'replaceNewline' => '', |
| 35 | 35 | 'enabled' => YII_DEBUG && !YII_ENV_TEST, |
| 36 | 36 | ], |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | 'settings' => [ |
| 56 | 56 | 'class' => 'pheme\settings\Module', |
| 57 | 57 | 'layout' => '@backend/views/layouts/box', |
| 58 | - 'accessRoles' => ['settings-module'], |
|
| 58 | + 'accessRoles' => [ 'settings-module' ], |
|
| 59 | 59 | ], |
| 60 | 60 | ], |
| 61 | 61 | ]; |