diff --git a/console/controllers/ClearController.php b/console/controllers/ClearController.php index d1e63a1..3e3a5dd 100644 --- a/console/controllers/ClearController.php +++ b/console/controllers/ClearController.php @@ -16,18 +16,23 @@ */ class ClearController extends Controller { + public $defaultAction = 'phrase'; /** * Remove old searches */ public function actionPhrase() { + $this->stdout('phraseLiveTime: ' . \Yii::$app->cmsSearch->phraseLiveTime . "\n"); + if (\Yii::$app->cmsSearch->phraseLiveTime) { $deleted = CmsSearchPhrase::deleteAll([ '<=', 'created_at', \Yii::$app->formatter->asTimestamp(time()) - (int) \Yii::$app->cmsSearch->phraseLiveTime ]); - \Yii::info(\Yii::t('skeeks/search', 'Removing searches') . " :" . $deleted, 'skeeks/search'); + $message = \Yii::t('skeeks/search', 'Removing searches') . " :" . $deleted; + \Yii::info($message, 'skeeks/search'); + $this->stdout("\t" . $message . "\n"); } }