Fixed Unable to rebuild daily stats from CLI

Jake B.

Well-known member
Affected version
2.2.9
Currently if the daily stats need to be rebuilt for some reason (such as importing from another software) it cannot be done through the CLI, and you are required to sit with your browser open while it runs which can take quite some time on sites that have been around for more than a few years and have a lot of content. The following CLI command definition resolves this issue:

PHP:
<?php

namespace XF\Cli\Command\Rebuild;

use Symfony\Component\Console\Input\InputOption;

class RebuildStats extends AbstractRebuildCommand
{
    protected function getRebuildName()
    {
        return 'stats';
    }

    protected function getRebuildDescription()
    {
        return 'Rebuilds daily statistics.';
    }

    protected function getRebuildClass()
    {
        return 'XF:Stats';
    }

    protected function configureOptions()
    {
        $this
            ->addOption(
                'delete',
                null,
                InputOption::VALUE_NONE,
                'Delete existing cached data. Default: false'
            );
    }
}
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.10).

Change log:
Support rebuilding daily stats from the command line
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom