2017 © Pedro Peláez
 

symfony-bundle couchbasebundle

Symfony2 bundle to manipulate Couchbase Documents.

image

toiine/couchbasebundle

Symfony2 bundle to manipulate Couchbase Documents.

  • Wednesday, July 24, 2013
  • by toiine
  • Repository
  • 3 Watchers
  • 8 Stars
  • 1,355 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

CouchbaseBundle

Symfony2 bundle to manipulate Couchbase Documents., (*1)

Build Status Build Status SensioLabsInsight, (*2)

Installation

Installing the bundle via packagist is the quickest and simplest method of installing the bundle. Here are the steps:, (*3)

Step 1: Composer require

$ php composer.phar require "toiine/couchbasebundle":"dev-master"

Step 2: Enable the bundle in the kernel

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Toiine\CouchbaseBundle\ToiineCouchbaseBundle(),
        // ...
    );
}

Configuration

There is a sample configuration file in Resources/config/couchbase.yml.dist, (*4)

connections:
  conn1:
    # default is "localhost"
    # host:
    # default is 8091
    # port:
    username: admin
    password: admin
    bucket: default
  conn2:
    host: couchbase.tld
    port: 8092
    username: couchbase
    password: cOuchb4s3
    bucket: bucket2

Services

A compiler pass will generate services according to the configuration file, (*5)

php app/console container:debug | grep couchbase
Service name Class
toiine_couchbase.conn1 Couchbase
toiine_couchbase.conn2 Couchbase

You can use toiine_couchbase.<connectionName> services to manipulate you documents., (*6)

NB: documentation on other services will come soon., (*7)

Usage

<?php

namespace Acme\HelloBundle\Controller;

use Symfony\Component\HttpFoundation\Response;

class DocController
{
    public function getDocumentAction($key)
    {
        $couchbase = $this->get('toiine_couchbase.conn1');

        // Get a doc from couchbase
        $doc = $couchbase->get($key);

        // Push a doc to couchbase
        $couchbase->set($key, $doc);

        // Delete a doc from couchbase
        $couchbase->delete($key);

        ...
    }
}

TODO

  • add a profiling panel in the web debug toolbar : see the calls and the time they took
  • integrate Jms Serializer : manipulate Entities through Couchbase the same way as Doctrine EntityManager

The Versions

24/07 2013

dev-master

9999999-dev https://github.com/toiine/CouchbaseBundle

Symfony2 bundle to manipulate Couchbase Documents.

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

by Antoine Reyt

couchbase

24/07 2013

dev-develop

dev-develop https://github.com/toiine/CouchbaseBundle

Symfony2 bundle to manipulate Couchbase Documents.

  Sources   Download

GPL-3.0

The Requires

 

The Development Requires

by Antoine Reyt

couchbase