Permalink
Browse files

removed prefix detection, added connection setting

  • Loading branch information...
1 parent 5330785 commit 67077cbd6fdacee1e7e81f7b9ecf7aa0dfbf7959 @phishy phishy committed Feb 13, 2013
Showing with 11 additions and 14 deletions.
  1. +9 −13 extensions/data/source/Couchbase.php
  2. +2 −1 tests/cases/extensions/data/source/CouchbaseTest.php
@@ -94,21 +94,17 @@ class Couchbase extends \lithium\data\Source {
*/
public function __construct(array $config = array()) {
$defaults = array(
- 'host' => 'localhost:8091',
- 'login' => null,
- 'password' => null,
- 'database' => 'default',
- 'persistent' => true,
- 'autoViews' => true,
+ 'host' => 'localhost:8091',
+ 'login' => null,
+ 'password' => null,
+ 'database' => 'default',
+ 'persistent' => true,
+ 'autoViews' => true,
+ 'createViews' => true,
+ 'prefix' => 'dev_'
);
- if (Environment::get() == 'production') {
- $this->prefix = '';
- $defaults['createViews'] = false;
- } else {
- $this->prefix = 'dev_';
- $defaults['createViews'] = true;
- }
parent::__construct($config + $defaults);
+ $this->prefix = $this->_config['prefix'];
}
/**
@@ -53,7 +53,8 @@ public function testDefaults() {
'autoConnect' => true,
'init' => false,
'autoViews' => true,
- 'createViews' => true
+ 'createViews' => true,
+ 'prefix' => 'dev_'
);
$cb = new Couchbase(array('init' => false));

0 comments on commit 67077cb

Please sign in to comment.