Skip to content

Commit

Permalink
Removed skeeks/cms/base/Module
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Apr 20, 2016
1 parent a4a0b85 commit 975288b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion console/controllers/ClearController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down

0 comments on commit 975288b

Please sign in to comment.