@@ -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 | 'web' => [ |
| 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' => YII_DEBUG ? null : '', |
| 35 | 35 | 'enabled' => YII_DEBUG && !YII_ENV_TEST, |
| 36 | 36 | ], |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | 'settings' => [ |
| 51 | 51 | 'class' => 'pheme\settings\Module', |
| 52 | 52 | 'layout' => '@backend/views/layouts/box', |
| 53 | - 'accessRoles' => ['settings-module'], |
|
| 53 | + 'accessRoles' => [ 'settings-module' ], |
|
| 54 | 54 | ], |
| 55 | 55 | ], |
| 56 | 56 | ]; |
@@ -11,16 +11,16 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | use yii\helpers\FileHelper; |
| 13 | 13 | |
| 14 | -$srcPath = __DIR__ . '/..'; |
|
| 14 | +$srcPath = __DIR__.'/..'; |
|
| 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($srcPath . '/' . getenv('ENV_LOCAL_FILE')); |
|
| 18 | + $localEnv = FileHelper::normalizePath($srcPath.'/'.getenv('ENV_LOCAL_FILE')); |
|
| 19 | 19 | if (is_file($localEnv)) { |
| 20 | 20 | $dotenvLocal = new Dotenv\Dotenv($srcPath, 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', |
@@ -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 | } |
@@ -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, |
@@ -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)); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function actionVersion() |
| 57 | 57 | { |
| 58 | 58 | $this->stdout('Application Version: '); |
| 59 | - $this->stdout(getenv('APP_NAME') . ' '); |
|
| 59 | + $this->stdout(getenv('APP_NAME').' '); |
|
| 60 | 60 | $this->stdout(APP_VERSION); |
| 61 | 61 | echo "\n"; |
| 62 | 62 | } |
@@ -71,12 +71,12 @@ discard block |
||
| 71 | 71 | $this->stdout("=====================\n"); |
| 72 | 72 | $this->stdout("Initializing application\n"); |
| 73 | 73 | |
| 74 | - $this->interactive = (bool)getenv('APP_INTERACTIVE'); |
|
| 74 | + $this->interactive = (bool) getenv('APP_INTERACTIVE'); |
|
| 75 | 75 | |
| 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("\nUser\n"); |
| 82 | 82 | $this->stdout("----\n"); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | 'default' => getenv('APP_ADMIN_PASSWORD') ?: \Yii::$app->security->generateRandomString(8), |
| 87 | 87 | ] |
| 88 | 88 | ); |
| 89 | - $this->run('user/create', [getenv('APP_ADMIN_EMAIL'), 'admin', $adminPassword]); |
|
| 89 | + $this->run('user/create', [ getenv('APP_ADMIN_EMAIL'), 'admin', $adminPassword ]); |
|
| 90 | 90 | |
| 91 | 91 | $this->stdout("\n\nDone.\n"); |
| 92 | 92 | } |
@@ -99,8 +99,8 @@ discard block |
||
| 99 | 99 | $this->stdout("\nCleanup\n"); |
| 100 | 100 | $this->stdout("-------\n"); |
| 101 | 101 | $this->run('cache/flush-all'); |
| 102 | - $this->run('audit/cleanup', ['age' => 30, 'interactive' => (bool)getenv('APP_INTERACTIVE')]); |
|
| 103 | - $this->run('app/clear-assets', ['interactive' => (bool)getenv('APP_INTERACTIVE')]); |
|
| 102 | + $this->run('audit/cleanup', [ 'age' => 30, 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
| 103 | + $this->run('app/clear-assets', [ 'interactive' => (bool) getenv('APP_INTERACTIVE') ]); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -114,20 +114,20 @@ discard block |
||
| 114 | 114 | $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]$"'; |
| 115 | 115 | |
| 116 | 116 | // create $cmd command |
| 117 | - $cmd = 'cd "' . $assets . '" && ls | grep -e ' . $matchRegex . ' | xargs rm -rf '; |
|
| 117 | + $cmd = 'cd "'.$assets.'" && ls | grep -e '.$matchRegex.' | xargs rm -rf '; |
|
| 118 | 118 | |
| 119 | 119 | // Set command |
| 120 | 120 | $command = new Command($cmd); |
| 121 | 121 | |
| 122 | 122 | // Prompt user |
| 123 | - $delete = $this->confirm("\nDo you really want to delete web assets?", ['default' => true]); |
|
| 123 | + $delete = $this->confirm("\nDo you really want to delete web assets?", [ 'default' => true ]); |
|
| 124 | 124 | |
| 125 | 125 | if ($delete) { |
| 126 | 126 | // Try to execute $command |
| 127 | 127 | if ($command->execute()) { |
| 128 | 128 | echo "Web assets have been deleted.\n\n"; |
| 129 | 129 | } else { |
| 130 | - echo "\n" . $command->getError() . "\n"; |
|
| 130 | + echo "\n".$command->getError()."\n"; |
|
| 131 | 131 | echo $command->getStdErr(); |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -16,10 +16,10 @@ discard block |
||
| 16 | 16 | $languages = explode(',', getenv('APP_LANGUAGES')); |
| 17 | 17 | |
| 18 | 18 | // prepare asset bundle config |
| 19 | -$bundles = []; |
|
| 19 | +$bundles = [ ]; |
|
| 20 | 20 | if (getenv('APP_ASSET_USE_BUNDLED')) { |
| 21 | 21 | // include generated asset-bundle configuration |
| 22 | - $bundles = include Yii::getAlias('@web/bundles') . '/config.php'; |
|
| 22 | + $bundles = include Yii::getAlias('@web/bundles').'/config.php'; |
|
| 23 | 23 | // disable loading of bundles skin file, when using bundled assets |
| 24 | 24 | Yii::$container->set( |
| 25 | 25 | AdminLteAsset::className(), |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | return [ |
| 62 | 62 | 'id' => 'app', |
| 63 | 63 | 'name' => getenv('APP_TITLE'), |
| 64 | - 'language' => $languages[0], |
|
| 64 | + 'language' => $languages[ 0 ], |
|
| 65 | 65 | 'basePath' => dirname(__DIR__), |
| 66 | 66 | 'vendorPath' => '@app/../vendor', |
| 67 | 67 | 'runtimePath' => '@app/../runtime', |
@@ -79,8 +79,8 @@ discard block |
||
| 79 | 79 | ], |
| 80 | 80 | 'params' => [ |
| 81 | 81 | 'adminEmail' => getenv('APP_ADMIN_EMAIL'), |
| 82 | - 'context.menuItems' => [], |
|
| 83 | - 'backend.iframe.name' => 'backend-' . getenv('HOSTNAME'), |
|
| 82 | + 'context.menuItems' => [ ], |
|
| 83 | + 'backend.iframe.name' => 'backend-'.getenv('HOSTNAME'), |
|
| 84 | 84 | ], |
| 85 | 85 | 'components' => [ |
| 86 | 86 | 'assetManager' => [ |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | ], |
| 93 | 93 | 'authManager' => [ |
| 94 | 94 | 'class' => \yii\rbac\DbManager::class, |
| 95 | - 'defaultRoles' => ['Default'], |
|
| 95 | + 'defaultRoles' => [ 'Default' ], |
|
| 96 | 96 | 'cache' => 'cache' |
| 97 | 97 | ], |
| 98 | 98 | 'cache' => |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | 'key' => getenv('AMAZON_S3_BUCKET_PUBLIC_KEY'), |
| 119 | 119 | 'secret' => getenv('AMAZON_S3_BUCKET_SECRET_KEY'), |
| 120 | 120 | 'bucket' => getenv('AMAZON_S3_BUCKET_NAME'), |
| 121 | - 'prefix' => getenv('APP_NAME') . '/public', |
|
| 121 | + 'prefix' => getenv('APP_NAME').'/public', |
|
| 122 | 122 | 'region' => getenv('AMAZON_S3_BUCKET_REGION'), |
| 123 | 123 | ], |
| 124 | 124 | 'fsRuntime' => [ |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | 'common' => [ |
| 145 | 145 | 'class' => \codemix\streamlog\Target::class, |
| 146 | 146 | 'url' => 'php://stderr', |
| 147 | - 'levels' => ['error', 'warning'], |
|
| 148 | - 'logVars' => [], |
|
| 147 | + 'levels' => [ 'error', 'warning' ], |
|
| 148 | + 'logVars' => [ ], |
|
| 149 | 149 | 'replaceNewline' => (APP_TYPE == 'console') ? null : '', |
| 150 | 150 | ], |
| 151 | 151 | ], |
@@ -180,9 +180,9 @@ discard block |
||
| 180 | 180 | 'user' => [ |
| 181 | 181 | 'class' => \dmstr\web\User::class, |
| 182 | 182 | 'enableAutoLogin' => true, |
| 183 | - 'loginUrl' => ['/user/security/login'], |
|
| 183 | + 'loginUrl' => [ '/user/security/login' ], |
|
| 184 | 184 | 'identityClass' => Da\User\Model\User::class, |
| 185 | - 'rootUsers' => ['admin'], |
|
| 185 | + 'rootUsers' => [ 'admin' ], |
|
| 186 | 186 | ], |
| 187 | 187 | 'urlManager' => [ |
| 188 | 188 | 'class' => \codemix\localeurls\UrlManager::class, |
@@ -213,24 +213,24 @@ discard block |
||
| 213 | 213 | 'auto_reload' => true, |
| 214 | 214 | ], |
| 215 | 215 | 'globals' => [ |
| 216 | - 'Html' => ['class' => \yii\helpers\Html::class], |
|
| 217 | - 'Json' => ['class' => \yii\helpers\Json::class], |
|
| 218 | - 'Tree' => ['class' => \dmstr\modules\pages\models\Tree::class], |
|
| 219 | - 'FA' => ['class' => \rmrevin\yii\fontawesome\FA::class], |
|
| 220 | - 'FileUrl' => ['class' => \hrzg\filemanager\helpers\Url::class], |
|
| 221 | - 'Url' => ['class' => \yii\helpers\Url::class], |
|
| 216 | + 'Html' => [ 'class' => \yii\helpers\Html::class ], |
|
| 217 | + 'Json' => [ 'class' => \yii\helpers\Json::class ], |
|
| 218 | + 'Tree' => [ 'class' => \dmstr\modules\pages\models\Tree::class ], |
|
| 219 | + 'FA' => [ 'class' => \rmrevin\yii\fontawesome\FA::class ], |
|
| 220 | + 'FileUrl' => [ 'class' => \hrzg\filemanager\helpers\Url::class ], |
|
| 221 | + 'Url' => [ 'class' => \yii\helpers\Url::class ], |
|
| 222 | 222 | ], |
| 223 | 223 | 'functions' => [ |
| 224 | - 'image' => function ($imageSource, $preset = null) { |
|
| 224 | + 'image' => function($imageSource, $preset = null) { |
|
| 225 | 225 | // preset example, when using imageproxy, https://github.com/willnorris/imageproxy#examples |
| 226 | 226 | if (getenv('IMAGEPROXY_SIGNATURE_KEY')) { |
| 227 | 227 | $key = getenv('IMAGEPROXY_SIGNATURE_KEY'); |
| 228 | - $preset .= ',s' . strtr(base64_encode(hash_hmac('sha256', $imageSource, $key, 1)), '/+', '_-'); |
|
| 228 | + $preset .= ',s'.strtr(base64_encode(hash_hmac('sha256', $imageSource, $key, 1)), '/+', '_-'); |
|
| 229 | 229 | } |
| 230 | - return Yii::$app->settings->get('imgBaseUrl', 'app.frontend') . |
|
| 231 | - $preset . |
|
| 232 | - Yii::$app->settings->get('imgHostPrefix', 'app.frontend') . |
|
| 233 | - $imageSource . |
|
| 230 | + return Yii::$app->settings->get('imgBaseUrl', 'app.frontend'). |
|
| 231 | + $preset. |
|
| 232 | + Yii::$app->settings->get('imgHostPrefix', 'app.frontend'). |
|
| 233 | + $imageSource. |
|
| 234 | 234 | Yii::$app->settings->get('imgHostSuffix', 'app.frontend'); |
| 235 | 235 | }, |
| 236 | 236 | ], |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | 'modules' => [ |
| 245 | 245 | 'audit' => [ |
| 246 | 246 | 'class' => \bedezign\yii2\audit\Audit::class, |
| 247 | - 'accessRoles' => ['audit-module'], |
|
| 247 | + 'accessRoles' => [ 'audit-module' ], |
|
| 248 | 248 | 'layout' => $boxLayout, |
| 249 | 249 | 'panels' => [ |
| 250 | 250 | 'audit/request', |
@@ -252,9 +252,9 @@ discard block |
||
| 252 | 252 | 'audit/trail', |
| 253 | 253 | 'audit/javascript', # enable app.assets.registerJSLoggingAsset via settings |
| 254 | 254 | // These provide special functionality and get loaded to activate it |
| 255 | - 'audit/error', // Links the extra error reporting functions (`exception()` and `errorMessage()`) |
|
| 256 | - 'audit/extra', // Links the data functions (`data()`) |
|
| 257 | - 'audit/curl', // Links the curl tracking function (`curlBegin()`, `curlEnd()` and `curlExec()`) |
|
| 255 | + 'audit/error', // Links the extra error reporting functions (`exception()` and `errorMessage()`) |
|
| 256 | + 'audit/extra', // Links the data functions (`data()`) |
|
| 257 | + 'audit/curl', // Links the curl tracking function (`curlBegin()`, `curlEnd()` and `curlExec()`) |
|
| 258 | 258 | //'audit/db', |
| 259 | 259 | //'audit/log', |
| 260 | 260 | //'audit/profiling', |
@@ -326,14 +326,14 @@ discard block |
||
| 326 | 326 | 'class' => \lajax\translatemanager\Module::class, |
| 327 | 327 | 'root' => '@app/views', |
| 328 | 328 | 'layout' => $boxLayout, |
| 329 | - 'allowedIPs' => ['*'], |
|
| 330 | - 'roles' => ['translate-module'], |
|
| 329 | + 'allowedIPs' => [ '*' ], |
|
| 330 | + 'roles' => [ 'translate-module' ], |
|
| 331 | 331 | ], |
| 332 | 332 | 'user' => [ |
| 333 | 333 | 'class' => Da\User\Module::class, |
| 334 | 334 | 'layout' => '@app/views/layouts/container', |
| 335 | 335 | 'defaultRoute' => 'admin', |
| 336 | - 'administrators' => ['admin'], |
|
| 336 | + 'administrators' => [ 'admin' ], |
|
| 337 | 337 | 'enableFlashMessages' => false, |
| 338 | 338 | 'enableRegistration' => getenv('APP_USER_ENABLE_REGISTRATION'), |
| 339 | 339 | ], |