@@ -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 | } |
@@ -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 | |
@@ -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'); |