Go to the documentation of this file.
47 $this->dbr = $database;
48 } elseif ( $database ) {
60 $this->
edits = $this->dbr->selectField(
'revision',
'COUNT(*)',
'', __METHOD__ );
61 $this->
edits += $this->dbr->selectField(
'archive',
'COUNT(*)',
'', __METHOD__ );
71 $config = MediaWikiServices::getInstance()->getMainConfig();
76 'page_is_redirect' => 0,
79 if ( $config->get(
'ArticleCountMethod' ) ==
'link' ) {
81 $conds[] =
'pl_from=page_id';
84 $this->
articles = $this->dbr->selectField(
86 'COUNT(DISTINCT page_id)',
99 $this->
pages = $this->dbr->selectField(
'page',
'COUNT(*)',
'', __METHOD__ );
109 $this->
users = $this->dbr->selectField(
'user',
'COUNT(*)',
'', __METHOD__ );
119 $this->
files = $this->dbr->selectField(
'image',
'COUNT(*)',
'', __METHOD__ );
138 $counter =
new self( $database );
141 $counter->articles();
159 $exists = $dbw->selectField(
'site_stats',
'1', [
'ss_row_id' => 1 ], __METHOD__ );
160 if ( $exists ===
false ) {
197 private static function getDB( $index, $groups = [] ) {
198 $lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
200 return $lb->getConnection( $index, $groups );
processing should stop and the error should be shown to the user * false
static doAllAndCommit( $database, array $options=[])
Do all updates and commit them.
articles()
Count pages in article space(s)
pages()
Count total pages.
static getDB( $index, $groups=[])
this hook is for auditing only RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist & $tables
static getContentNamespaces()
Get a list of all namespace indices which are considered to contain content.
Class designed for counting of stats.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
files()
Count total files.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
users()
Count total users.
static cacheUpdate(IDatabase $dbw)
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
__construct( $database=false)
edits()
Count the total number of edits.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
static doPlaceholderInit()
Insert a dummy row with all zeroes if no row is present.
refresh()
Refresh site_stats.