From: Tim Starling Date: Tue, 12 May 2009 13:43:51 +0000 (+0000) Subject: Quick hack to allow creation of blobs tables with names other than "blobs" X-Git-Tag: 1.31.0-rc.0~41818 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=acd0ba25342ba6b8f36fe8ba13adaef751e2c2a4;p=lhc%2Fweb%2Fwiklou.git Quick hack to allow creation of blobs tables with names other than "blobs" --- diff --git a/maintenance/addwiki.php b/maintenance/addwiki.php index ebe52f2ed0..4f076ae75c 100644 --- a/maintenance/addwiki.php +++ b/maintenance/addwiki.php @@ -63,7 +63,6 @@ function addWiki( $lang, $site, $dbName ) } if ( count( $stores ) ) { require_once( 'ExternalStoreDB.php' ); - print "Initialising external storage $store...\n"; global $wgDBuser, $wgDBpassword, $wgExternalServers; foreach ( $stores as $storeURL ) { $m = array(); @@ -72,17 +71,23 @@ function addWiki( $lang, $site, $dbName ) } $cluster = $m[1]; + print "Initialising external storage $cluster...\n"; # Hack $wgExternalServers[$cluster][0]['user'] = $wgDBuser; $wgExternalServers[$cluster][0]['password'] = $wgDBpassword; - + $store = new ExternalStoreDB; - $extdb =& $store->getMaster( $cluster ); + $extdb = $store->getMaster( $cluster ); $extdb->query( "SET table_type=InnoDB" ); $extdb->query( "CREATE DATABASE $dbName" ); $extdb->selectDB( $dbName ); - dbsource( "$maintenance/storage/blobs.sql", $extdb ); + + # Hack x2 + $blobsTable = $store->getTable( $extdb ); + $blobsFile = popen( "sed s/blobs\\\\\\>/$blobsTable/ $maintenance/storage/blobs.sql", 'r' ); + $extdb->sourceStream( $blobsFile ); + pclose( $blobsFile ); $extdb->immediateCommit(); } }