@@ -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', |
@@ -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 | ?> |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | use Yii; |
| 15 | 15 | |
| 16 | 16 | // PHP Constants |
| 17 | -$version = is_file(__DIR__ . '/../src/version') ? trim(file_get_contents(__DIR__ . '/../src/version')) : 'dev'; |
|
| 17 | +$version = is_file(__DIR__.'/../src/version') ? trim(file_get_contents(__DIR__.'/../src/version')) : 'dev'; |
|
| 18 | 18 | defined('APP_VERSION') or define('APP_VERSION', $version); |
| 19 | 19 | $projectVersion = is_file(__DIR__.'/../project/version') ? trim(file_get_contents(__DIR__.'/../project/version')) : 'vanilla'; |
| 20 | 20 | defined('PROJECT_VERSION') or define('PROJECT_VERSION', $projectVersion); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | Yii::setAlias('@webroot', '@root/web'); |
| 28 | 28 | |
| 29 | 29 | // Use a closure to not pollute the global namespace |
| 30 | -return call_user_func(function () { |
|
| 30 | +return call_user_func(function() { |
|
| 31 | 31 | |
| 32 | 32 | /*function checkFile(){ |
| 33 | 33 | if (file_exists($file)) { |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | "{$configDir}/".APP_TYPE.'.php' => true, |
| 42 | 42 | "{$configDir}/common-".YII_ENV.'.php' => false, |
| 43 | 43 | "{$configDir}/".APP_TYPE.'-'.YII_ENV.'.php' => false, |
| 44 | - "{$configDir}/".APP_TYPE.'-'.((YII_DEBUG)?'debug':'release').'.php' => false, |
|
| 44 | + "{$configDir}/".APP_TYPE.'-'.((YII_DEBUG) ? 'debug' : 'release').'.php' => false, |
|
| 45 | 45 | ]; |
| 46 | 46 | |
| 47 | 47 | if (!empty(getenv('APP_CONFIG_FILE'))) { |
@@ -49,12 +49,12 @@ discard block |
||
| 49 | 49 | // Merge additional configurations |
| 50 | 50 | foreach ($additionalConfigFiles as $alias) { |
| 51 | 51 | $file = Yii::getAlias($alias); |
| 52 | - $configFiles[$file] = true; |
|
| 52 | + $configFiles[ $file ] = true; |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | // Merge configurations |
| 57 | - $config = []; |
|
| 57 | + $config = [ ]; |
|
| 58 | 58 | //var_dump($configFiles);exit; |
| 59 | 59 | Yii::trace($configFiles, __METHOD__); |
| 60 | 60 | foreach ($configFiles as $file => $isRequired) { |
@@ -16,9 +16,9 @@ |
||
| 16 | 16 | // Codeception testing routes |
| 17 | 17 | if (YII_ENV_TEST && file_exists($rootPath . '/tests/codeception/c3.php')) { |
| 18 | 18 | define('C3_CODECOVERAGE_ERROR_LOG_FILE', |
| 19 | - getenv('C3_CODECOVERAGE_ERROR_LOG_FILE')); //Optional (if not set the default c3 output dir will be used) |
|
| 19 | + getenv('C3_CODECOVERAGE_ERROR_LOG_FILE')); //Optional (if not set the default c3 output dir will be used) |
|
| 20 | 20 | define('C3_CODECEPTION_CONFIG_PATH', |
| 21 | - getenv('C3_CODECEPTION_CONFIG_PATH')); //Optional (if not set the default c3 output dir will be used) |
|
| 21 | + getenv('C3_CODECEPTION_CONFIG_PATH')); //Optional (if not set the default c3 output dir will be used) |
|
| 22 | 22 | require_once $rootPath . '/tests/codeception/c3.php'; |
| 23 | 23 | } |
| 24 | 24 | |
@@ -1,26 +1,26 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // Prepare environment |
| 4 | -$rootPath = realpath(__DIR__ . '/..'); |
|
| 5 | -require($rootPath . '/vendor/autoload.php'); |
|
| 6 | -require($rootPath . '/config/env.php'); |
|
| 4 | +$rootPath = realpath(__DIR__.'/..'); |
|
| 5 | +require($rootPath.'/vendor/autoload.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 | |
| 13 | 13 | // Load framework |
| 14 | -require($rootPath . '/vendor/yiisoft/yii2/Yii.php'); |
|
| 14 | +require($rootPath.'/vendor/yiisoft/yii2/Yii.php'); |
|
| 15 | 15 | |
| 16 | 16 | // Codeception testing routes |
| 17 | -if (YII_ENV_TEST && file_exists($rootPath . '/tests/codeception/c3.php')) { |
|
| 17 | +if (YII_ENV_TEST && file_exists($rootPath.'/tests/codeception/c3.php')) { |
|
| 18 | 18 | define('C3_CODECOVERAGE_ERROR_LOG_FILE', |
| 19 | 19 | getenv('C3_CODECOVERAGE_ERROR_LOG_FILE')); //Optional (if not set the default c3 output dir will be used) |
| 20 | 20 | define('C3_CODECEPTION_CONFIG_PATH', |
| 21 | 21 | getenv('C3_CODECEPTION_CONFIG_PATH')); //Optional (if not set the default c3 output dir will be used) |
| 22 | - require_once $rootPath . '/tests/codeception/c3.php'; |
|
| 22 | + require_once $rootPath.'/tests/codeception/c3.php'; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // Run application |
| 26 | -(new yii\web\Application(require($rootPath . '/config/main.php')))->run(); |
|
| 26 | +(new yii\web\Application(require($rootPath.'/config/main.php')))->run(); |
|
@@ -21,10 +21,10 @@ discard block |
||
| 21 | 21 | $languages = explode(',', getenv('APP_LANGUAGES')); |
| 22 | 22 | |
| 23 | 23 | // prepare asset bundle config |
| 24 | -$bundles = []; |
|
| 24 | +$bundles = [ ]; |
|
| 25 | 25 | if (getenv('APP_ASSET_USE_BUNDLED')) { |
| 26 | 26 | // include generated asset-bundle configuration |
| 27 | - $bundles = include Yii::getAlias('@web/bundles') . '/config.php'; |
|
| 27 | + $bundles = include Yii::getAlias('@web/bundles').'/config.php'; |
|
| 28 | 28 | // disable loading of bundles skin file, when using bundled assets |
| 29 | 29 | Yii::$container->set( |
| 30 | 30 | AdminLteAsset::className(), |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | return [ |
| 41 | 41 | 'id' => 'app', |
| 42 | 42 | 'name' => getenv('APP_TITLE'), |
| 43 | - 'language' => $languages[0], |
|
| 43 | + 'language' => $languages[ 0 ], |
|
| 44 | 44 | 'basePath' => '@app', |
| 45 | 45 | 'vendorPath' => '@root/vendor', |
| 46 | 46 | 'runtimePath' => '@root/runtime', |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | ], |
| 59 | 59 | 'params' => [ |
| 60 | 60 | 'adminEmail' => getenv('APP_ADMIN_EMAIL'), |
| 61 | - 'context.menuItems' => [], |
|
| 61 | + 'context.menuItems' => [ ], |
|
| 62 | 62 | 'backend.iframe.name' => getenv('APP_PARAMS_BACKEND_IFRAME_NAME') ?: '_self', |
| 63 | 63 | 'backend.browserSupport' => [ |
| 64 | 64 | 'Chrome' => 72, |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | 'container' => [ |
| 75 | 75 | 'definitions' => [ |
| 76 | 76 | AuthDbManagerComponent::class => [ |
| 77 | - 'defaultRoles' => ['Default'], |
|
| 77 | + 'defaultRoles' => [ 'Default' ], |
|
| 78 | 78 | 'cache' => 'cache' |
| 79 | 79 | ], |
| 80 | 80 | Da\User\Controller\AdminController::class => [ |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | 'key' => getenv('AMAZON_S3_BUCKET_PUBLIC_KEY'), |
| 125 | 125 | 'secret' => getenv('AMAZON_S3_BUCKET_SECRET_KEY'), |
| 126 | 126 | 'bucket' => getenv('AMAZON_S3_BUCKET_NAME'), |
| 127 | - 'prefix' => getenv('APP_NAME') . '/public', |
|
| 127 | + 'prefix' => getenv('APP_NAME').'/public', |
|
| 128 | 128 | 'region' => getenv('AMAZON_S3_BUCKET_REGION'), |
| 129 | 129 | ], |
| 130 | 130 | 'fsRuntime' => [ |
@@ -150,8 +150,8 @@ discard block |
||
| 150 | 150 | 'common' => [ |
| 151 | 151 | 'class' => \codemix\streamlog\Target::class, |
| 152 | 152 | 'url' => 'php://stderr', |
| 153 | - 'levels' => ['error', 'warning'], |
|
| 154 | - 'logVars' => [], |
|
| 153 | + 'levels' => [ 'error', 'warning' ], |
|
| 154 | + 'logVars' => [ ], |
|
| 155 | 155 | 'replaceNewline' => (APP_TYPE == 'console') ? null : '', |
| 156 | 156 | ], |
| 157 | 157 | ], |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | 'messageConfig' => [ |
| 173 | 173 | 'charset' => 'UTF-8', |
| 174 | 174 | 'returnPath' => getenv('APP_MAILER_RETURN_PATH'), |
| 175 | - 'from' => [getenv('APP_MAILER_FROM') => getenv('APP_TITLE')], |
|
| 175 | + 'from' => [ getenv('APP_MAILER_FROM') => getenv('APP_TITLE') ], |
|
| 176 | 176 | ], |
| 177 | 177 | ], |
| 178 | 178 | 'queue' => [ |
@@ -195,9 +195,9 @@ discard block |
||
| 195 | 195 | 'user' => [ |
| 196 | 196 | 'class' => \dmstr\web\User::class, |
| 197 | 197 | 'enableAutoLogin' => true, |
| 198 | - 'loginUrl' => ['/user/security/login'], |
|
| 198 | + 'loginUrl' => [ '/user/security/login' ], |
|
| 199 | 199 | 'identityClass' => Da\User\Model\User::class, |
| 200 | - 'rootUsers' => ['admin'], |
|
| 200 | + 'rootUsers' => [ 'admin' ], |
|
| 201 | 201 | ], |
| 202 | 202 | 'urlManager' => [ |
| 203 | 203 | 'class' => \codemix\localeurls\UrlManager::class, |
@@ -228,37 +228,37 @@ discard block |
||
| 228 | 228 | 'auto_reload' => true, |
| 229 | 229 | ], |
| 230 | 230 | 'globals' => [ |
| 231 | - 'Html' => ['class' => \yii\helpers\Html::class], |
|
| 232 | - 'Json' => ['class' => \yii\helpers\Json::class], |
|
| 233 | - 'Tree' => ['class' => \dmstr\modules\pages\models\Tree::class], |
|
| 234 | - 'FA' => ['class' => \rmrevin\yii\fontawesome\FA::class], |
|
| 235 | - 'FileUrl' => ['class' => \hrzg\filemanager\helpers\Url::class], |
|
| 236 | - 'Url' => ['class' => \yii\helpers\Url::class], |
|
| 237 | - 'Markdown' => ['class' => \yii\helpers\Markdown::class], |
|
| 231 | + 'Html' => [ 'class' => \yii\helpers\Html::class ], |
|
| 232 | + 'Json' => [ 'class' => \yii\helpers\Json::class ], |
|
| 233 | + 'Tree' => [ 'class' => \dmstr\modules\pages\models\Tree::class ], |
|
| 234 | + 'FA' => [ 'class' => \rmrevin\yii\fontawesome\FA::class ], |
|
| 235 | + 'FileUrl' => [ 'class' => \hrzg\filemanager\helpers\Url::class ], |
|
| 236 | + 'Url' => [ 'class' => \yii\helpers\Url::class ], |
|
| 237 | + 'Markdown' => [ 'class' => \yii\helpers\Markdown::class ], |
|
| 238 | 238 | ], |
| 239 | 239 | 'functions' => [ |
| 240 | - 'image' => function ($imageSource, $preset = null) { |
|
| 240 | + 'image' => function($imageSource, $preset = null) { |
|
| 241 | 241 | // sanitize input |
| 242 | 242 | $preset = trim($preset, "/"); |
| 243 | 243 | $baseUrl = trim(Yii::$app->settings->get('imgBaseUrl', 'app.frontend'), "/"); |
| 244 | 244 | $prefix = trim(Yii::$app->settings->get('imgHostPrefix', 'app.frontend'), "/"); |
| 245 | - $imageSourceFull = $imageSource . Yii::$app->settings->get('imgHostSuffix', 'app.frontend'); |
|
| 245 | + $imageSourceFull = $imageSource.Yii::$app->settings->get('imgHostSuffix', 'app.frontend'); |
|
| 246 | 246 | |
| 247 | 247 | // build remote URL |
| 248 | - $remoteUrl = implode('/', array_filter([$prefix, $imageSourceFull])); |
|
| 248 | + $remoteUrl = implode('/', array_filter([ $prefix, $imageSourceFull ])); |
|
| 249 | 249 | |
| 250 | 250 | // add HMAC sign key to preset when using imageproxy, see also https://github.com/willnorris/imageproxy#examples |
| 251 | 251 | if (getenv('IMAGEPROXY_SIGNATURE_KEY')) { |
| 252 | 252 | $key = getenv('IMAGEPROXY_SIGNATURE_KEY'); |
| 253 | - $preset .= ',s' . strtr( |
|
| 253 | + $preset .= ',s'.strtr( |
|
| 254 | 254 | base64_encode(hash_hmac('sha256', $remoteUrl, $key, 1)), |
| 255 | 255 | '/+', |
| 256 | 256 | '_-' |
| 257 | 257 | ); |
| 258 | 258 | } |
| 259 | - return implode('/', array_filter([$baseUrl, $preset, $remoteUrl])); |
|
| 259 | + return implode('/', array_filter([ $baseUrl, $preset, $remoteUrl ])); |
|
| 260 | 260 | }, |
| 261 | - 't' => function ($category, $message, $params = [], $language = null) { |
|
| 261 | + 't' => function($category, $message, $params = [ ], $language = null) { |
|
| 262 | 262 | return Yii::t($category, $message, $params, $language); |
| 263 | 263 | }, |
| 264 | 264 | ], |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | 'modules' => [ |
| 273 | 273 | 'audit' => [ |
| 274 | 274 | 'class' => \bedezign\yii2\audit\Audit::class, |
| 275 | - 'accessRoles' => ['audit-module'], |
|
| 275 | + 'accessRoles' => [ 'audit-module' ], |
|
| 276 | 276 | 'layout' => $boxLayout, |
| 277 | 277 | 'panels' => [ |
| 278 | 278 | 'audit/trail' => [ |
@@ -366,12 +366,12 @@ discard block |
||
| 366 | 366 | [ |
| 367 | 367 | 'connection' => 'db', |
| 368 | 368 | 'table' => '{{%hrzg_widget_template}}', |
| 369 | - 'columns' => ['twig_template'] |
|
| 369 | + 'columns' => [ 'twig_template' ] |
|
| 370 | 370 | ], |
| 371 | 371 | [ |
| 372 | 372 | 'connection' => 'db', |
| 373 | 373 | 'table' => '{{%twig}}', |
| 374 | - 'columns' => ['value'] |
|
| 374 | + 'columns' => [ 'value' ] |
|
| 375 | 375 | ] |
| 376 | 376 | ], |
| 377 | 377 | 'scanners' => [ |
@@ -380,15 +380,15 @@ discard block |
||
| 380 | 380 | ScannerJavaScriptFunction::class, |
| 381 | 381 | ScannerDatabase::class |
| 382 | 382 | ], |
| 383 | - 'allowedIPs' => ['*'], |
|
| 384 | - 'roles' => ['translate-module'], |
|
| 383 | + 'allowedIPs' => [ '*' ], |
|
| 384 | + 'roles' => [ 'translate-module' ], |
|
| 385 | 385 | ], |
| 386 | 386 | 'user' => [ |
| 387 | 387 | 'class' => Da\User\Module::class, |
| 388 | 388 | 'layout' => '@app/views/layouts/container', |
| 389 | 389 | 'defaultRoute' => 'admin', |
| 390 | 390 | 'administratorPermissionName' => 'user-module', |
| 391 | - 'administrators' => ['admin'], |
|
| 391 | + 'administrators' => [ 'admin' ], |
|
| 392 | 392 | 'enableFlashMessages' => false, |
| 393 | 393 | 'enableRegistration' => getenv('APP_USER_ENABLE_REGISTRATION'), |
| 394 | 394 | '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 | - $this->run('db/create', [getenv('DB_ENV_MYSQL_ROOT_USER'),getenv('DB_ENV_MYSQL_ROOT_PASSWORD')]); |
|
| 80 | - $this->run('migrate/up', ['interactive' => (bool)getenv('APP_INTERACTIVE')]); |
|
| 79 | + $this->run('db/create', [ getenv('DB_ENV_MYSQL_ROOT_USER'), getenv('DB_ENV_MYSQL_ROOT_PASSWORD') ]); |
|
| 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'); |
@@ -69,10 +69,10 @@ |
||
| 69 | 69 | <!-- Navbar --> |
| 70 | 70 | <?php |
| 71 | 71 | if (Yii::$app->settings->get('enableTwigNavbar', 'app.layout', false)) { |
| 72 | - echo \dmstr\modules\prototype\widgets\TwigWidget::widget(['key' => '_navbar']); |
|
| 73 | - } else { |
|
| 74 | - echo $this->render('_navbar'); |
|
| 75 | - } |
|
| 72 | + echo \dmstr\modules\prototype\widgets\TwigWidget::widget(['key' => '_navbar']); |
|
| 73 | + } else { |
|
| 74 | + echo $this->render('_navbar'); |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | 77 | ?> |
| 78 | 78 | |
@@ -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 | ?> |
@@ -64,12 +64,12 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | <?php $this->beginBody() ?> |
| 66 | 66 | |
| 67 | -<?= TwigWidget::widget(['key' => '_beginBody', 'renderEmpty' => false]) ?> |
|
| 67 | +<?= TwigWidget::widget([ 'key' => '_beginBody', 'renderEmpty' => false ]) ?> |
|
| 68 | 68 | |
| 69 | 69 | <!-- Navbar --> |
| 70 | 70 | <?php |
| 71 | 71 | if (Yii::$app->settings->get('enableTwigNavbar', 'app.layout', false)) { |
| 72 | - echo \dmstr\modules\prototype\widgets\TwigWidget::widget(['key' => '_navbar']); |
|
| 72 | + echo \dmstr\modules\prototype\widgets\TwigWidget::widget([ 'key' => '_navbar' ]); |
|
| 73 | 73 | } else { |
| 74 | 74 | echo $this->render('_navbar'); |
| 75 | 75 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | ?> |
| 78 | 78 | |
| 79 | 79 | <!-- Content --> |
| 80 | -<?= TwigWidget::widget(['key' => '_beforeContent', 'renderEmpty' => false]) ?> |
|
| 80 | +<?= TwigWidget::widget([ 'key' => '_beforeContent', 'renderEmpty' => false ]) ?> |
|
| 81 | 81 | |
| 82 | 82 | <div class="wrap"> |
| 83 | 83 | |
@@ -85,12 +85,12 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | </div> |
| 87 | 87 | |
| 88 | -<?= TwigWidget::widget(['key' => '_afterContent', 'renderEmpty' => false]) ?> |
|
| 88 | +<?= TwigWidget::widget([ 'key' => '_afterContent', 'renderEmpty' => false ]) ?> |
|
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | <!-- Footer --> |
| 92 | 92 | <footer class="footer"> |
| 93 | - <?= Cell::widget(['id' => '_footer', 'requestParam' => '_global']) ?> |
|
| 93 | + <?= Cell::widget([ 'id' => '_footer', 'requestParam' => '_global' ]) ?> |
|
| 94 | 94 | </footer> |
| 95 | 95 | |
| 96 | 96 | <!-- User flash messages --> |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | ], |
| 105 | 105 | ]) ?> |
| 106 | 106 | |
| 107 | -<?= TwigWidget::widget(['key' => '_endBody', 'renderEmpty' => false]) ?> |
|
| 107 | +<?= TwigWidget::widget([ 'key' => '_endBody', 'renderEmpty' => false ]) ?> |
|
| 108 | 108 | |
| 109 | 109 | <?php if (Yii::$app->user->can('backend_default_index')): ?> |
| 110 | 110 | |