-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from eluhr/feature/refurbish
Feature/refurbish
- Loading branch information
Showing
11 changed files
with
391 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* @link http://www.diemeisterei.de/ | ||
* @copyright Copyright (c) 2020 diemeisterei GmbH, Stuttgart | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace dmstr\modules\backend\controllers; | ||
|
||
|
||
use yii\web\Controller; | ||
use Yii; | ||
|
||
class CacheController extends Controller | ||
{ | ||
/** | ||
* flush cache | ||
* | ||
* if APCu is used as cache we cannot flush cache from cli command | ||
* see: https://github.com/yiisoft/yii2/issues/8647 | ||
* | ||
* @return \yii\web\Response | ||
*/ | ||
public function actionFlush() | ||
{ | ||
if (\Yii::$app->cache->flush()) { | ||
\Yii::$app->session->addFlash('success', Yii::t('backend-module','Cache cleared')); | ||
} else { | ||
\Yii::$app->session->addFlash('error', Yii::t('backend-module','Cannot clear cache')); | ||
} | ||
return $this->redirect(['default/index']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
|
||
namespace dmstr\modules\backend\controllers; | ||
|
||
|
||
use dmstr\helpers\Metadata; | ||
use yii\data\ArrayDataProvider; | ||
use yii\web\Controller; | ||
use Yii; | ||
|
||
class ConfigController extends Controller | ||
{ | ||
/** | ||
* Application configuration. | ||
* | ||
* @return string | ||
*/ | ||
public function actionView() | ||
{ | ||
$loadedModules = Metadata::getModules(); | ||
$loadedModulesDataProvider = new ArrayDataProvider(['allModels' => $loadedModules]); | ||
$loadedModulesDataProvider->pagination->pageSize = 100; | ||
|
||
$components = Yii::$app->getComponents(); | ||
ksort($components); | ||
$modules = Yii::$app->getModules(); | ||
ksort($modules); | ||
$env = $_ENV; | ||
ksort($env); | ||
|
||
|
||
return $this->render( | ||
'view', | ||
[ | ||
'params' => Yii::$app->params, | ||
'components' => $components, | ||
'modules' => $modules, | ||
'env' => $env, | ||
'loadedModulesDataProvider' => $loadedModulesDataProvider, | ||
] | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.