GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing doc.wikimedia.org — MediaWiki: maintenance/initSiteStats.php Source File
Toggle main menu visibility
initSiteStats.php
Go to the documentation of this file.
1<?php
11
15
16// @codeCoverageIgnoreStart
17require_once __DIR__ . '/Maintenance.php';
18// @codeCoverageIgnoreEnd
19
27 parent::__construct();
28 $this->addDescription( 'Re-initialise the site statistics tables' );
29 $this->addOption( 'update', 'Update the existing statistics' );
30 $this->addOption( 'active', 'Also update active users count' );
31 $this->addOption( 'use-master', 'Count using the primary database' );
32 }
33
35 $this->output( "Refresh Site Statistics\n\n" );
37
38 $this->output( "Counting total edits..." );
39 $edits = $counter->edits();
40 $this->output( "{$edits}\nCounting number of articles..." );
41
42 $good = $counter->articles();
43 $this->output( "{$good}\nCounting total pages..." );
44
45 $pages = $counter->pages();
46 $this->output( "{$pages}\nCounting number of users..." );
47
48 $users = $counter->users();
49 $this->output( "{$users}\nCounting number of images..." );
50
51 $image = $counter->files();
52 $this->output( "{$image}\n" );
53
54 if ( $this->hasOption( 'update' ) ) {
55 $this->output( "\nUpdating site statistics..." );
56 $counter->refresh();
57 $this->output( "done.\n" );
58 } else {
59 $this->output( "\nTo update the site statistics table, run the script "
60 . "with the --update option.\n" );
61 }
62
63 if ( $this->hasOption( 'active' ) ) {
64 $this->output( "\nCounting and updating active users..." );
65 $active = SiteStatsUpdate::cacheUpdate( $this->getPrimaryDB() );
66 $this->output( "{$active}\n" );
67 }
68
69 $this->output( "\nDone.\n" );
70 }
71}
72
73// @codeCoverageIgnoreStart
74$maintClass = InitSiteStats::class;
75require_once RUN_MAINTENANCE_IF_MAIN;
76// @codeCoverageIgnoreEnd
Maintenance script to re-initialise or update the site statistics table. Definition initSiteStats.php:25 Class for handling updates to the site_stats table. Definition SiteStatsUpdate.php:20 static cacheUpdate(IDatabase $dbw) Definition SiteStatsUpdate.php:173 Class designed for counting of stats. Definition SiteStatsInit.php:19 Definition applyChangeTag.php:11
| |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |