*/
class ExternalStore {
var $mParams;
-
+
+ /**
+ * @param $params array
+ */
function __construct( $params = array() ) {
$this->mParams = $params;
}
-
+
/**
* Fetch data from given URL
*
*
* @param $proto String: type of external storage, should be a value in $wgExternalStores
* @param $params Array: associative array of parameters for the ExternalStore object.
- * @return ExternalStore subclass or false on error
+ * @return ExternalStore|bool ExternalStore class or false on error
*/
static function getStoreObject( $proto, $params = array() ) {
global $wgExternalStores;
return $store->store( $params, $data );
}
}
-
+
/**
* Like insert() above, but does more of the work for us.
* This function does not need a url param, it builds it by
*
* @param $data String
* @param $storageParams Array: associative array of parameters for the ExternalStore object.
+ * @throws DBConnectionError|DBQueryError|MWException
* @return string The URL of the stored data item, or false on error
*/
public static function insertToDefault( $data, $storageParams = array() ) {
throw new MWException( "Unable to store text to external storage" );
}
}
-
+
/**
* @param $data
* @param $wiki
*/
class ExternalStoreDB {
+ /**
+ * @param $params array
+ */
function __construct( $params = array() ) {
$this->mParams = $params;
}
*
* @param $cluster String: the cluster name
* @param $data String: the data item
+ * @throws MWException
* @return string URL
*/
function store( $cluster, $data ) {