PHPackages                             zumba/swivel-cake - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. zumba/swivel-cake

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

zumba/swivel-cake
=================

A CakePHP plugin to provide easy access to zumba/swivel

v2.0.4(5y ago)276.8k↓19.4%MITPHPPHP &gt;=5.4

Since Apr 24Pushed 5y ago33 watchersCompare

[ Source](https://github.com/zumba/swivel-cake)[ Packagist](https://packagist.org/packages/zumba/swivel-cake)[ Docs](https://github.com/zumba/swivel-cake)[ RSS](/packages/zumba-swivel-cake/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (20)Used By (0)

CakePHP Plugin for Zumba ***Swivel***
=====================================

[](#cakephp-plugin-for-zumba-swivel)

[Zumba Swivel](https://github.com/zumba/swivel) is a library that allows PHP applications to manage features to multiple users via buckets. It consists with 10 buckets, allowing the same code have up to 10 different behaviors.

This plugin is a bridge between CakePHP and Swivel. It provides a helper, component and behavior classes to be used in your CakePHP application.

Installation
------------

[](#installation)

You can install Swivel Cake into your project using [composer](http://getcomposer.org). For existing applications you can add the following to your `composer.json` file:

```
    "require": {
        "zumba/swivel-cake": "1.*"
    }

```

And run `php composer.phar update`

Loading the Plugin
------------------

[](#loading-the-plugin)

After installing, you should tell your application to load the plugin:

```
CakePlugin::load('Swivel', ['bootstrap' => true]);
```

Configuration
-------------

[](#configuration)

The plugin has default configurations and is ready to use. However, you can customize some of the configurations.

ConfigurationDefault ValueDescriptionCookie.enabled`true`If cookie should be set at allCookie.name`Swivel_Bucket`Cookie name used to store the client bucket number.Cookie.expire`0`Expiration, in seconds, of the cookie. Setting 0 means a session cookie.Cookie.path`/`Cookie's path.Cookie.domain`env('HTTP_HOST')`Domain name used for the cookie.Cookie.secure`false`If cookie can be only used in secure transmissions, ie. HTTPSCookie.httpOnly`false`If cookie can be accessed via other sources other than HTTP, ie. JavaScriptBucketIndex`null`Defines the user's bucket. Leaving null it will auto-generate a number between 1 and 10.LoaderAlias`SwivelManager`Name that will be used to store the instance on Cake's `ClassRegistry`.Logger`null`Instance to receive the logs. Setting to `null` will make the log be discarded.Metrics`null`Metrics instance.ModelAlias`Swivel.SwivelFeature`Model name that will provide the swivel mapping configuration.To set custom configurations, you need to create a file in `APP/Config/swivel.php` and set the fields you want to override. Here is the default configuration file:

```
