uppercase URL
[lhc/web/wiklou.git] / includes / ExternalStoreDB.php
1 <?php
2 /**
3 *
4 * @package MediaWiki
5 *
6 * DB accessable external objects
7 *
8 */
9 require_once( 'LoadBalancer.php' );
10
11
12
13 class ExternalStoreDB {
14 /* Fetch data from given URL */
15 function fetchFromURL($url) {
16 global $wgExternalServers;
17 #
18 # URLs have the form DB://cluster/id, e.g.
19 # DB://cluster1/3298247
20 #
21 $path = explode( '/', $url );
22 $cluster = $path[2];
23 $id = $path[3];
24
25 $lb = LoadBalancer::NewFromParams( $wgExternalServers[$cluster] );
26 $db = $lb->getConnection( DB_SLAVE );
27
28 $ret = $db->selectField( 'text', 'text_text', array( 'text_id' => $id ) );
29
30 return $ret;
31 }
32
33 /* XXX: may require other methods, for store, delete,
34 * whatever, for initial ext storage
35 */
36 }
37 ?>