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-12-11 15:49:32 +01:00

44 lines
888 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(): string
{
return 'Rebuild the forum bbcode cache.';
}
/**
* Does the repository installing.
*/
public function execute(): void
{
$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();
}
$this->getLogger()->writeln("Done!");
}
}