cache frequently-used subscriber, subscription, notice and fave count values

This commit is contained in:
Evan Prodromou
2009-07-09 17:28:38 -07:00
parent efd94b4e54
commit 8b65883f9d
7 changed files with 157 additions and 44 deletions

View File

@@ -97,18 +97,11 @@ class StatsCommand extends Command
{
function execute($channel)
{
$profile = $this->user->getProfile();
$subs = new Subscription();
$subs->subscriber = $this->user->id;
$subs_count = (int) $subs->count() - 1;
$subbed = new Subscription();
$subbed->subscribed = $this->user->id;
$subbed_count = (int) $subbed->count() - 1;
$notices = new Notice();
$notices->profile_id = $this->user->id;
$notice_count = (int) $notices->count();
$subs_count = $profile->subscriptionCount();
$subbed_count = $profile->subscriberCount();
$notice_count = $profile->noticeCount();
$channel->output($this->user, sprintf(_("Subscriptions: %1\$s\n".
"Subscribers: %2\$s\n".