GitHub - iTechDhaval/ICBaseRiakBundle · GitHub
Skip to content

iTechDhaval/ICBaseRiakBundle

 
 

Repository files navigation

InstaClick Base Riak Bundle

Build Status

IMPORTANT NOTICE: This bundle is still under development. Any changes will be done without prior notice to consumers of this package. Of course this code will become stable at a certain point, but for now, use at your own risk.

Introduction

This bundle provides Riak support to Symfony2 applications.

This bundle requires that you are using, at least, Symfony 2.2.

Installation

Installing this bundle can be done through these simple steps:

  1. Add this bundle to your project as a composer dependency:
    // composer.json
    {
        // ...
        require-dev: {
            // ...
            "instaclick/base-riak-bundle": "dev-master"
        }
    }
  1. Add this bundle in your application kernel:
    // application/ApplicationKernel.php
    public function registerBundles()
    {
        // ...
        $bundles[] = new IC\Bundle\Base\RiakBundle\ICBaseRiakBundle();

        return $bundles;
    }
  1. Double check if the bundle is configured correctly:
# application/config/ic_base_riak.yml
    ic_base_riak:
    default_connection: 'default'
    connections:
        default:
            host: 'cache-server'
            port: 8087
    buckets:
        the_manolo_bucket: my_serious_bucket_name
        my_another_serious_bucket: ~
  1. Create a service and inject it into the desired service
<services>
        <service id="Acme.cache.manolo"
                 class="Doctrine\Common\Cache\RiakCache">
            <argument type="service" id="ic_base_riak.bucket.the_manolo_bucket"/>
            <call method="setNamespace">
                <argument>the_manolo_bucket</argument>
            </call>
        </service>

        <service id="Acme.service.manolo" class="Acme\Service\Manolo">
            <call method="setCachepProvider">
                <argument type="service" id="Acme.cache.manolo" />
            </call>
        </service>
</services>

Usage

Check the PHP-Riak extension Github Page or the Doctrine Cache Interface for a better undestanding of the Cache API.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

  • PHP 100.0%