elphie/registry

This package is abandoned and no longer maintained. No replacement package was suggested.

Laravel 4 registry manager for application configurations and settings

v2.0.1 2013-09-10 16:07 UTC

This package is not auto-updated.

Last update: 2017-11-05 07:24:03 UTC


README

Build Status Coverage Status

Registry manager for Laravel 4. An alternative for managing application configurations and settings.

Installation

Add the following into your composer.json file:

{
	"require": {
		"elphie\registry": "2.0.x"
	}
}

Add the service provider and alias into your app/config/app.php

'providers' => array(
	'Elphie\Registry\RegistryServiceProvider',
),

'Registry' => 'Elphie\Registry\Facades\Registry',

Run php artisan config:publish "elphie\registry"

Run php artisan migrate --package="elphie\registry" to install the registry table

Changelogs

ver 2.0

  • Add Driver interface
  • Add Registry manager
  • Add Fluent registry driver
  • Remove set() function
  • Add store(), dump() and flush() functions

Usage

Retrieve item from registry

Registry::get('foo'); \\will return null if key does not exists
Registry::get('foo.bar'); \\will return null if key does not exists

Registry::get('foo', 'undefine') \\will return undefine if key does not exists

Store item into registry

Registry::store('foo', 'bar');
Registry::store('foo', array('bar' => 'foobar'));

Registry::get('foo'); \\bar
Registry::get('foo.bar'); \\foobar

Remove item from registry

Registry::forget('foo');
Registry::forget('foo.bar');

Flush registry table

Registry::flush();

Dump all values from an item

Registry::dump('foo');