@@ -614,26 +614,15 @@ private function startCacheInstance(array $config = array())
614
614
} else if ($ adapter instanceof \Doctrine \Common \Cache \CouchbaseCache) {
615
615
616
616
// Couchbase configuration
617
- $ couchbaseConfig = array (
618
- 'hosts ' => array ('localhost:8091 ' ),
619
- 'user ' => isset ($ config ['options ' ]['user ' ]) ? $ config ['options ' ]['user ' ] : '' ,
620
- 'password ' => isset ($ config ['options ' ]['password ' ]) ? $ config ['options ' ]['password ' ] : '' ,
621
- 'bucket ' => isset ($ config ['options ' ]['bucket ' ]) ? $ config ['options ' ]['bucket ' ] : 'default ' ,
622
- 'persistent ' => isset ($ config ['options ' ]['persistent ' ]) ? $ config ['options ' ]['persistent ' ] : true ,
623
- );
624
-
625
- if (isset ($ config ['options ' ]['servers ' ])) {
626
-
627
- unset($ couchbaseConfig ['hosts ' ]);
628
-
629
- foreach ($ config ['options ' ]['servers ' ] as $ server ) {
630
- $ couchbaseConfig ['hosts ' ][] = $ server ;
631
- }
632
- }
617
+ $ hosts = isset ($ config ['options ' ]['hosts ' ]) ? $ config ['options ' ]['hosts ' ] : array ('localhost ' );
618
+ $ user = isset ($ config ['options ' ]['user ' ]) ? $ config ['options ' ]['user ' ] : '' ;
619
+ $ password = isset ($ config ['options ' ]['password ' ]) ? $ config ['options ' ]['password ' ] : '' ;
620
+ $ bucket = isset ($ config ['options ' ]['bucket ' ]) ? $ config ['options ' ]['bucket ' ] : 'default ' ;
621
+ $ persistent = isset ($ config ['options ' ]['persistent ' ]) ? $ config ['options ' ]['persistent ' ] : true ;
633
622
634
623
// Prevent stupid PHP error of missing extension (if other driver is being used)
635
624
$ couchbaseClassName = 'Couchbase ' ;
636
- $ couchbase = new $ couchbaseClassName ($ couchbaseConfig );
625
+ $ couchbase = new $ couchbaseClassName ($ hosts , $ user , $ password , $ bucket , $ persistent );
637
626
638
627
$ adapter ->setCouchbase ($ couchbase );
639
628
} else if ($ adapter instanceof \Doctrine \Common \Cache \MemcacheCache) {
0 commit comments