This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/app/Console/Command/RebuildForumCacheCommand.php
2016-10-07 21:21:05 +02:00

44 lines
877 B
PHP

<?php
/**
* Holds the forum bbcode cache rebuilder.
* @package Sakura
*/
namespace Sakura\Console\Command;
use CLIFramework\Command;
use Sakura\DB;
use Sakura\Forum\Post;
/**
* Rebuilds the forum bbcode cache.
* @package Sakura
* @author Julian van de Groep <me@flash.moe>
*/
class RebuildForumCacheCommand extends Command
{
/**
* A quick description of this command.
* @return string.
*/
public function brief()
{
return 'Rebuild the forum bbcode cache';
}
/**
* Does the repository installing.
*/
public function execute()
{
$this->getLogger()->writeln("This might take a while...");
$posts = DB::table('posts')->get(['post_id']);
foreach ($posts as $post) {
(new Post($post->post_id))->update(true);
}
$this->getLogger()->writeln("Done!");
}
}