- /**
- * Get an external store object of the given type, with the given parameters
- *
- * @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|bool ExternalStore class or false on error
- */
- static function getStoreObject( $proto, $params = array() ) {
- global $wgExternalStores;
- if( !$wgExternalStores ) {
- return false;
- }
-
- /* Protocol not enabled */
- if( !in_array( $proto, $wgExternalStores ) ) {
- return false;
- }
-
- $class = 'ExternalStore' . ucfirst( $proto );
- /* Any custom modules should be added to $wgAutoLoadClasses for on-demand loading */
- if( !MWInit::classExists( $class ) ) {
- return false;
- }
-
- return new $class($params);
- }
-