From 283ef9a0402a65b42a556081d09a928811b24997 Mon Sep 17 00:00:00 2001 From: Ross Singer Date: Wed, 2 May 2018 14:01:38 -0400 Subject: [PATCH] Add an interface for MongoConfig --- src/mongo/Config.class.php | 7 +- src/mongo/IConfigInstance.php | 308 ++++++++++++++++++++++++++++ src/mongo/base/DriverBase.class.php | 4 +- 3 files changed, 314 insertions(+), 5 deletions(-) create mode 100644 src/mongo/IConfigInstance.php diff --git a/src/mongo/Config.class.php b/src/mongo/Config.class.php index 8ae9f988..62ecd5c7 100644 --- a/src/mongo/Config.class.php +++ b/src/mongo/Config.class.php @@ -16,7 +16,7 @@ /** * Holds the global configuration for Tripod */ -class Config implements ITripodConfigSerializer +class Config implements IConfigInstance { /** @@ -1131,7 +1131,7 @@ public static function getConfig() /** * Returns a list of the configured indexes grouped by collection * @param string $storeName - * @return mixed + * @return array */ public function getIndexesGroupedByCollection($storeName) { @@ -1189,7 +1189,8 @@ public function getIndexesGroupedByCollection($storeName) * @param string $storeName The database name to use. * @param string $collName The collection in the database. * @param string $qName Either the qname to get the values for or empty for all cardinality values. - * @return mixed If no qname is specified then returns an array of cardinality options, otherwise returns the cardinality value for the given qname. + * @return array|int If no qname is specified then returns an array of cardinality options, + * otherwise returns the cardinality value for the given qname. */ public function getCardinality($storeName,$collName,$qName=null) { diff --git a/src/mongo/IConfigInstance.php b/src/mongo/IConfigInstance.php new file mode 100644 index 00000000..8ad37ed2 --- /dev/null +++ b/src/mongo/IConfigInstance.php @@ -0,0 +1,308 @@ +