* general category and can be viewed as a named subset of all logs; and
* an action, which is a specific kind of event that can exist in that
* log type.
+ *
+ * Note that code should call LogPage::validTypes() to get a list of valid
+ * log types instead of checking the global variable.
*/
$wgLogTypes = [
'',
ApiBase::PARAM_HELP_MSG_PER_VALUE => [],
],
'type' => [
- ApiBase::PARAM_TYPE => $config->get( 'LogTypes' )
+ ApiBase::PARAM_TYPE => LogPage::validTypes(),
],
'action' => [
// validation on request is done in execute()
* @return string[] subpages
*/
public function getSubpagesForPrefixSearch() {
- $subpages = $this->getConfig()->get( 'LogTypes' );
+ $subpages = LogPage::validTypes();
$subpages[] = 'all';
sort( $subpages );
return $subpages;
$parms = explode( '/', $par );
$symsForAll = [ '*', 'all' ];
if ( $parms[0] != '' &&
- ( in_array( $par, $this->getConfig()->get( 'LogTypes' ) ) || in_array( $par, $symsForAll ) )
+ ( in_array( $par, LogPage::validTypes() ) || in_array( $par, $symsForAll ) )
) {
$opts->setValue( 'type', $par );
} elseif ( count( $parms ) == 2 ) {
* Rebuild pass 3: Insert `recentchanges` entries for action logs.
*/
private function rebuildRecentChangesTablePass3( ILBFactory $lbFactory ) {
- global $wgLogTypes, $wgLogRestrictions;
+ global $wgLogRestrictions;
$dbw = $this->getDB( DB_MASTER );
$commentStore = CommentStore::getStore();
'log_timestamp < ' . $dbw->addQuotes( $dbw->timestamp( $this->cutoffTo ) ),
// Some logs don't go in RC since they are private.
// @FIXME: core/extensions also have spammy logs that don't go in RC.
- 'log_type' => array_diff( $wgLogTypes, array_keys( $wgLogRestrictions ) ),
+ 'log_type' => array_diff( LogPage::validTypes(), array_keys( $wgLogRestrictions ) ),
],
__METHOD__,
[ 'ORDER BY' => 'log_timestamp DESC' ],