r73351 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73350‎ | r73351 | r73352 >
Date:23:29, 19 September 2010
Author:nad
Status:deferred
Tags:
Comment:
add function to create a DB table ready for caching queries
Modified paths:
  • /trunk/extensions/RecordAdmin/RecordAdmin.php (modified) (history)
  • /trunk/extensions/RecordAdmin/RecordAdmin_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php
@@ -907,4 +907,19 @@
908908 function guid() {
909909 return $this->guid = strftime( '%Y%m%d', time() ) . '-' . substr( strtoupper( uniqid('', true) ), -5 );
910910 }
 911+
 912+
 913+ /**
 914+ * Create DB table for caching queries
 915+ */
 916+ function createCacheTable() {
 917+ $dbw = wfGetDB( DB_MASTER );
 918+ $tbl = $dbw->tableName( 'recordadmin_querycache' );
 919+ if ( !$dbw->tableExists( $tbl ) ) {
 920+ $query = "CREATE TABLE $tbl (raqc_id INT(32) NOT NULL, raqc_type TINYTEXT, raqc_content TEXT, raqc_state TINYTEXT, PRIMARY KEY (raqc_id));";
 921+ $result = $dbw->query( $query );
 922+ $dbw->freeResult( $result );
 923+ }
 924+ }
 925+
911926 }
Index: trunk/extensions/RecordAdmin/RecordAdmin.php
@@ -10,7 +10,7 @@
1111 * @author Siebrand Mazeland
1212 * @licence GNU General Public Licence 2.0 or later
1313 */
14 -define( 'RECORDADMIN_VERSION', '1.0.0, 2010-09-18' );
 14+define( 'RECORDADMIN_VERSION', '1.0.1, 2010-09-20' );
1515
1616 $dir = dirname( __FILE__ ) . '/';
1717 $wgExtensionMessagesFiles['RecordAdmin'] = $dir . 'RecordAdmin.i18n.php';

Status & tagging log