r23341 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23340‎ | r23341 | r23342 >
Date:02:16, 25 June 2007
Author:robchurch
Status:old
Tags:
Comment:
* Introduce $wgReportCacheLimit; default limit for maintenance/updateReports.php
* Introduce $wgCustomReports so extensions can register custom Report classes
* Remove some obsolete globals
Modified paths:
  • /branches/robchurch/reports/includes/DefaultSettings.php (modified) (history)
  • /branches/robchurch/reports/includes/reports/Report.php (modified) (history)
  • /branches/robchurch/reports/maintenance/updateReports.php (modified) (history)

Diff [purge]

Index: branches/robchurch/reports/maintenance/updateReports.php
@@ -11,7 +11,7 @@
1212
1313 $limit = isset( $options['limit'] )
1414 ? $options['limit']
15 - : 1000;
 15+ : $GLOBALS['wgReportCacheLimit'];
1616
1717 $reports = isset( $options['reports'] )
1818 ? explode( ',', $options['reports'] )
Index: branches/robchurch/reports/includes/reports/Report.php
@@ -13,7 +13,7 @@
1414 * Constructor
1515 */
1616 public function __construct() {
17 - parent::__construct( $this->getName() );
 17+ parent::__construct( $this->getName(), $this->getPermission() );
1818 }
1919
2020 /**
@@ -24,6 +24,15 @@
2525 public function getName() {}
2626
2727 /**
 28+ * Permission required to view the report
 29+ *
 30+ * @return string
 31+ */
 32+ public function getPermission() {
 33+ return '';
 34+ }
 35+
 36+ /**
2837 * Should this report be cached?
2938 *
3039 * @return bool
@@ -338,7 +347,7 @@
339348 'RedirectReport',
340349 'ShortPagesReport',
341350 'UncategorisedPagesReport',
342 - );
 351+ ) + GLOBALS['wgCustomReports'];
343352 }
344353
345354 }
Index: branches/robchurch/reports/includes/DefaultSettings.php
@@ -1350,16 +1350,29 @@
13511351
13521352 /** Disable database-intensive features */
13531353 $wgMiserMode = false;
1354 -/** Disable all query pages if miser mode is on, not just some */
1355 -$wgDisableQueryPages = false;
1356 -/** Number of rows to cache in 'querycache' table when miser mode is on */
1357 -$wgQueryCacheLimit = 1000;
13581354 /** Number of links to a page required before it is deemed "wanted" */
13591355 $wgWantedPagesThreshold = 1;
13601356 /** Enable slow parser functions */
13611357 $wgAllowSlowParserFunctions = false;
13621358
13631359 /**
 1360+ * Default cache set size for report cache
 1361+ */
 1362+$wgReportCacheLimit = 1000;
 1363+
 1364+/**
 1365+ * Set this to an array of report names to disable
 1366+ * cache updates for those pages
 1367+ */
 1368+$wgDisabledReports = array();
 1369+
 1370+/**
 1371+ * Extensions can add to this to register custom
 1372+ * Report classes
 1373+ */
 1374+$wgCustomReports = array();
 1375+
 1376+/**
13641377 * Maps jobs to their handling classes; extensions
13651378 * can add to this to provide custom jobs
13661379 */
@@ -2646,12 +2659,6 @@
26472660 $wgBreakFrames = false;
26482661
26492662 /**
2650 - * Set this to an array of report names to disable
2651 - * cache updates for those pages
2652 - */
2653 -$wgDisabledReports = array();
2654 -
2655 -/**
26562663 * Set this to false to disable cascading protection
26572664 */
26582665 $wgEnableCascadingProtection = true;

Status & tagging log