summaryrefslogtreecommitdiff
path: root/lib/command.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-07-09 17:28:38 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-07-09 17:28:38 -0700
commit8b65883f9ddf1cb1b7bdec323722da351fa0cb69 (patch)
tree6dcfeb299efe9088a904d4def7c263618380a692 /lib/command.php
parentefd94b4e5423c72a65cdd6acd252e5d00ec98967 (diff)
cache frequently-used subscriber, subscription, notice and fave count values
Diffstat (limited to 'lib/command.php')
-rw-r--r--lib/command.php15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/command.php b/lib/command.php
index 564661382..4e2280bc8 100644
--- a/lib/command.php
+++ b/lib/command.php
@@ -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".