Add the ability to define custom handlers for client options and connection parameters.

This commit is contained in:
Daniele Alessandri
2011-03-04 15:10:43 +01:00
parent d077aa67db
commit 2c4a9e92a6
2 changed files with 20 additions and 4 deletions
+10
View File
@@ -57,6 +57,16 @@ class ConnectionParameters {
return self::$_sharedOptions;
}
public static function define($name, Options\IOption $option) {
self::getSharedOptions();
self::$_sharedOptions[$name] = $option;
}
public static function undefine($name) {
self::getSharedOptions();
unset(self::$_sharedOptions[$name]);
}
protected function parseURI($uri) {
if (!is_string($uri)) {
throw new \InvalidArgumentException('URI must be a string');