Index: trunk/phase3/maintenance/addwiki.php |
— | — | @@ -63,7 +63,6 @@ |
64 | 64 | } |
65 | 65 | if ( count( $stores ) ) { |
66 | 66 | require_once( 'ExternalStoreDB.php' ); |
67 | | - print "Initialising external storage $store...\n"; |
68 | 67 | global $wgDBuser, $wgDBpassword, $wgExternalServers; |
69 | 68 | foreach ( $stores as $storeURL ) { |
70 | 69 | $m = array(); |
— | — | @@ -72,17 +71,23 @@ |
73 | 72 | } |
74 | 73 | |
75 | 74 | $cluster = $m[1]; |
| 75 | + print "Initialising external storage $cluster...\n"; |
76 | 76 | |
77 | 77 | # Hack |
78 | 78 | $wgExternalServers[$cluster][0]['user'] = $wgDBuser; |
79 | 79 | $wgExternalServers[$cluster][0]['password'] = $wgDBpassword; |
80 | | - |
| 80 | + |
81 | 81 | $store = new ExternalStoreDB; |
82 | | - $extdb =& $store->getMaster( $cluster ); |
| 82 | + $extdb = $store->getMaster( $cluster ); |
83 | 83 | $extdb->query( "SET table_type=InnoDB" ); |
84 | 84 | $extdb->query( "CREATE DATABASE $dbName" ); |
85 | 85 | $extdb->selectDB( $dbName ); |
86 | | - dbsource( "$maintenance/storage/blobs.sql", $extdb ); |
| 86 | + |
| 87 | + # Hack x2 |
| 88 | + $blobsTable = $store->getTable( $extdb ); |
| 89 | + $blobsFile = popen( "sed s/blobs\\\\\\>/$blobsTable/ $maintenance/storage/blobs.sql", 'r' ); |
| 90 | + $extdb->sourceStream( $blobsFile ); |
| 91 | + pclose( $blobsFile ); |
87 | 92 | $extdb->immediateCommit(); |
88 | 93 | } |
89 | 94 | } |