Skip to content

Commit

Permalink
Merge pull request #38 from dmstr/features/config-and-cleanup
Browse files Browse the repository at this point in the history
Features/config and cleanup
  • Loading branch information
schmunk42 authored Apr 21, 2021
2 parents ee5fcf2 + efdc2b1 commit 4315797
Show file tree
Hide file tree
Showing 16 changed files with 570 additions and 347 deletions.
360 changes: 221 additions & 139 deletions config/common.php

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions src/assets/AppAsset.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
<?php

namespace app\assets;

/*
/**
* @link http://www.yiiframework.com/
*
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/

namespace app\assets;

use yii\web\AssetBundle;
use yii\web\YiiAsset;
use yii\bootstrap\BootstrapAsset;

/**
* Configuration for `backend` client script files.
*
* @since 4.0
*/
class AppAsset extends \yii\web\AssetBundle
class AppAsset extends AssetBundle
{
public $sourcePath = '@app/assets/web';

Expand All @@ -25,7 +28,7 @@ class AppAsset extends \yii\web\AssetBundle
];

public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
YiiAsset::class,
BootstrapAsset::class,
];
}
17 changes: 10 additions & 7 deletions src/assets/AppJsAsset.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
<?php

namespace app\assets;

/*
/**
* @link http://www.yiiframework.com/
*
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/

namespace app\assets;

use yii\bootstrap\BootstrapPluginAsset;
use yii\web\AssetBundle;
use yii\web\YiiAsset;

/**
* Configuration for `backend` client script files.
*
* @since 4.0
*/
class AppJsAsset extends \yii\web\AssetBundle
class AppJsAsset extends AssetBundle
{
public $sourcePath = '@app/assets/web';

Expand All @@ -23,7 +26,7 @@ class AppJsAsset extends \yii\web\AssetBundle
];

public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapPluginAsset',
YiiAsset::class,
BootstrapPluginAsset::class,
];
}
13 changes: 6 additions & 7 deletions src/commands/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ public function actionVersion()
{
$this->stdout('Application Version: ');
$this->stdout(getenv('APP_NAME') . ' ');
$this->stdout(APP_VERSION);
echo "\n";
$this->stdout(APP_VERSION . "\n");
}

/**
Expand All @@ -84,7 +83,7 @@ public function actionSetup()
$adminPassword = $this->prompt(
'Enter admin password',
[
'default' => getenv('APP_ADMIN_PASSWORD') ?: \Yii::$app->security->generateRandomString(8),
'default' => getenv('APP_ADMIN_PASSWORD') ?: Yii::$app->security->generateRandomString(8),
]
);
$this->run('user/create', [getenv('APP_ADMIN_EMAIL'), 'admin', $adminPassword]);
Expand All @@ -111,7 +110,7 @@ public function actionCleanup()
*/
public function actionClearAssets()
{
$assets = \Yii::getAlias('@web/assets');
$assets = Yii::getAlias('@web/assets');

// Matches from 7-8 char folder names, the 8. char is optional
$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]$"';
Expand All @@ -128,10 +127,10 @@ public function actionClearAssets()
if ($delete) {
// Try to execute $command
if ($command->execute()) {
echo "Web assets have been deleted.\n\n";
$this->stdout("Web assets have been deleted.\n\n");
} else {
echo "\n" . $command->getError() . "\n";
echo $command->getStdErr();
$this->stderr("\n" . $command->getError() . "\n");
$this->stderr($command->getStdErr());
}
}
}
Expand Down
Loading

0 comments on commit 4315797

Please sign in to comment.