forked from GNUsocial/gnu-social
Nodeinfo has a special rule for upgrades
This commit is contained in:
parent
2f118fde9e
commit
df84ccd916
@ -176,4 +176,13 @@ class NodeinfoPlugin extends Plugin
|
||||
'description' => _m('Plugin that presents basic instance information using the NodeInfo standard.')];
|
||||
return true;
|
||||
}
|
||||
|
||||
public function onEndUpgrade()
|
||||
{
|
||||
$users = new Usage_stats();
|
||||
if ($users->getUserCount() == 0) {
|
||||
define('NODEINFO_UPGRADE', true);
|
||||
require_once __DIR__ . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR . 'fix_stats.php';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
define('INSTALLDIR', realpath(__DIR__ . '/../../..'));
|
||||
|
||||
if (!defined('NODEINFO_UPGRADE')) {
|
||||
|
||||
$longoptions = ['type='];
|
||||
|
||||
$helptext = <<<END_OF_HELP
|
||||
@ -52,6 +54,12 @@ if ($verbose) {
|
||||
echo "Started.\n\n";
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "Nodeinfo will now fix stats\n";
|
||||
$type_to_fix = 'all';
|
||||
$verbose = true;
|
||||
}
|
||||
|
||||
if ($type_to_fix == 'all' || $type_to_fix == 'users') {
|
||||
if ($verbose) {
|
||||
echo "[+] Updating Users stats...\n";
|
||||
|
Loading…
Reference in New Issue
Block a user