fix some issues with phpdoc
[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 /** @package MediaWiki */
13 class ExternalStoreDB {
14 /**
15 * Fetch data from given URL
16 * @param string $url An url
17 */
18 function fetchFromURL($url) {
19 global $wgExternalServers;
20 #
21 # URLs have the form DB://cluster/id, e.g.
22 # DB://cluster1/3298247
23 #
24 $path = explode( '/', $url );
25 $cluster = $path[2];
26 $id = $path[3];
27
28 $lb = LoadBalancer::NewFromParams( $wgExternalServers[$cluster] );
29 $db = $lb->getConnection( DB_SLAVE );
30
31 $ret = $db->selectField( 'blobs', 'blob_text', array( 'blob_id' => $id ) );
32
33 return $ret;
34 }
35
36 /* @fixme XXX: may require other methods, for store, delete,
37 * whatever, for initial ext storage
38 */
39 }
40 ?>