/**
  *
  * @param string $dataSourceName
  * @param string $databaseName
  */
 public function __construct($dataSourceName = '', $databaseName = '')
 {
     if ($dataSourceName !== '') {
         $this->client = new Client($dataSourceName);
         if ($databaseName !== '') {
             $this->client->setDatabaseName($databaseName);
         }
     }
 }
 /**
  * Opens the CouchDB connection
  *
  * @return void
  * @author Christopher Hlubek <*****@*****.**>
  * @api
  */
 public function open()
 {
     $this->client = new \TYPO3\CouchDB\Client($this->dataSourceName);
     if ($this->databaseName !== NULL) {
         $this->client->setDatabaseName($this->databaseName);
     }
     $this->reader = new \TYPO3\CouchDB\Log\Design\LogReaderDesign();
     $this->reader->setDesignName($this->designName);
     $this->reader->setClient($this->client);
 }
Example #3
0
 /**
  * Setup a CouchDB HTTP connector
  *
  * @return void
  * @author Christopher Hlubek <*****@*****.**>
  */
 public function setUp()
 {
     $this->client = $this->getAccessibleMock('TYPO3\\CouchDB\\Client', array('dummy'), array('http://127.0.0.1:5984'));
     $this->client->initializeObject();
     if ($this->client->databaseExists($this->databaseName)) {
         $this->client->deleteDatabase($this->databaseName);
     }
     $this->client->createDatabase($this->databaseName);
     $this->client->setDatabaseName($this->databaseName);
 }
 /**
  * @return void
  * @author Christopher Hlubek <*****@*****.**>
  */
 public function setUp()
 {
     parent::setUp();
     $configurationManager = $this->objectManager->get('TYPO3\\Flow\\Configuration\\ConfigurationManager');
     $backendOptions = $this->objectManager->getSettingsByPath(array('TYPO3', 'Flow', 'persistence', 'backendOptions'));
     $this->client = new \TYPO3\CouchDB\Client($backendOptions['dataSourceName']);
     if (isset($backendOptions['database']) && $backendOptions['database'] !== '') {
         $this->client->setDatabaseName($backendOptions['database']);
     }
 }
 /**
  * @return void
  * @author Christopher Hlubek <*****@*****.**>
  */
 public function setUp()
 {
     parent::setUp();
     $this->client = new \TYPO3\CouchDB\Client($this->dataSourceName);
     $this->client->setDatabaseName($this->databaseName);
     if ($this->client->databaseExists($this->databaseName)) {
         $this->client->deleteDatabase($this->databaseName);
     }
     $this->backend = new \TYPO3\CouchDB\Log\Backend\CouchDbBackend(array('databaseName' => $this->databaseName, 'dataSourceName' => $this->dataSourceName));
     $this->backend->open();
 }
Example #6
0
 /**
  * Setup a CouchDB HTTP connector
  *
  * @return void
  * @author Christopher Hlubek <*****@*****.**>
  */
 public function setUp()
 {
     $this->client = $this->getAccessibleMock('TYPO3\\CouchDB\\Client', array('dummy'), array('http://127.0.0.1:5984'));
     try {
         $this->client->initializeObject();
         if ($this->client->databaseExists($this->databaseName)) {
             $this->client->deleteDatabase($this->databaseName);
         }
     } catch (\RuntimeException $e) {
         $this->markTestSkipped('We skip the test as we can not connect to CouchDB Server');
     }
     $this->client->createDatabase($this->databaseName);
     $this->client->setDatabaseName($this->databaseName);
 }
 /**
  * Connect to CouchDB and select the database
  *
  * @return void
  */
 protected function connect()
 {
     $this->client = new \TYPO3\CouchDB\Client($this->dataSourceName, array('logSlowQueries' => $this->logSlowQueries, 'slowQueryThreshold' => $this->slowQueryThreshold));
     if ($this->databaseName !== NULL) {
         $this->client->setDatabaseName($this->databaseName);
     }
     $this->flow3Design = new Flow3Design($this->client);
 }