r23194 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23193‎ | r23194 | r23195 >
Date:03:27, 22 June 2007
Author:greg
Status:old
Tags:
Comment:
Postgres compatibility
Modified paths:
  • /trunk/extensions/BadImage/BadImage.class.php (modified) (history)
  • /trunk/extensions/BadImage/badimage.pg.sql (added) (history)
  • /trunk/extensions/BadImage/install.php (modified) (history)

Diff [purge]

Index: trunk/extensions/BadImage/BadImage.class.php
@@ -38,7 +38,7 @@
3939 global $wgMemc;
4040 wfProfileIn( __METHOD__ );
4141 $dbw =& wfGetDB( DB_MASTER );
42 - $dbw->insert( 'bad_images', array( 'bil_name' => $name, 'bil_user' => $user, 'bil_timestamp' => wfTimestampNow(), 'bil_reason' => $reason ), __METHOD__, 'IGNORE' );
 42+ $dbw->insert( 'bad_images', array( 'bil_name' => $name, 'bil_user' => $user, 'bil_timestamp' => $dbw->timestamp(), 'bil_reason' => $reason ), __METHOD__, 'IGNORE' );
4343 $wgMemc->delete( BadImageList::key( $name ) );
4444 wfProfileOut( __METHOD__ );
4545 }
Index: trunk/extensions/BadImage/badimage.pg.sql
@@ -0,0 +1,10 @@
 2+-- Postgres version
 3+CREATE TABLE bad_images (
 4+ bil_name TEXT NOT NULL,
 5+ bil_timestamp TIMESTAMPTZ NOT NULL,
 6+ bil_user INTEGER NOT NULL,
 7+ bil_reason TEXT NOT NULL
 8+);
 9+
 10+CREATE UNIQUE INDEX bil_name_unique ON bad_images (bil_name);
 11+
Property changes on: trunk/extensions/BadImage/badimage.pg.sql
___________________________________________________________________
Added: svn:eol-style
112 + native
Index: trunk/extensions/BadImage/install.php
@@ -51,12 +51,14 @@
5252 }
5353
5454 # Do nothing if the table exists
55 -if( !$dba->tableExists( 'bad_images' ) ) {
 55+if( $dba->tableExists( 'bad_images' ) ) {
 56+ echo( "The table already exists. No action was taken.\n" );
 57+} else {
 58+ if ($wgDBtype == 'postgres')
 59+ $sql = dirname( __FILE__ ) . '/badimage.pg.sql';
5660 if( $dba->sourceFile( $sql ) ) {
5761 echo( "The table has been set up correctly.\n" );
5862 }
59 -} else {
60 - echo( "The table already exists. No action was taken.\n" );
6163 }
6264
6365 # Close the connection

Status & tagging log