소스 검색

Allow users to undefine a default parameter.

Daniele Alessandri 14 년 전
부모
커밋
5ab210fd9d
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      lib/Predis/ConnectionParameters.php

+ 5 - 0
lib/Predis/ConnectionParameters.php

@@ -75,6 +75,11 @@ class ConnectionParameters implements IConnectionParameters {
         self::$_validators[$parameter] = $callable;
     }
 
+    public static function undefine($parameter) {
+        self::ensureDefaults();
+        unset(self::$_defaultParameters[$parameter], self::$_validators[$parameter]);
+    }
+
     private function parseURI($uri) {
         if (stripos($uri, 'unix') === 0) {
             // Hack to support URIs for UNIX sockets with minimal effort.