2017 © Pedro Peláez
 

library memory

Memory Component for Orchestra Platform

image

orchestra/memory

Memory Component for Orchestra Platform

  • Tuesday, July 31, 2018
  • by crynobone
  • Repository
  • 1 Watchers
  • 8 Stars
  • 69,825 Installations
  • PHP
  • 8 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 50 Versions
  • 4 % Grown

The README.md

Memory Component for Orchestra Platform

Memory Component handles runtime configuration either using "in memory" Runtime or database using Cache, Fluent Query Builder or Eloquent ORM. Instead of just allowing static configuration to be used, Memory Component allow those configuration to be persistent in between request by utilising multiple data storage option either through cache or database., (*1)

tests Latest Stable Version Total Downloads Latest Unstable Version License Coverage Status, (*2)

Version Compatibility

Laravel Memory
5.5.x 3.5.x
5.6.x 3.6.x
5.7.x 3.7.x
5.8.x 3.8.x
6.x 4.x
7.x 5.x
8.x 6.x

Installation

To install through composer, run the following command from terminal:, (*3)

composer require "orchestra/memory"

Configuration

Next add the service provider in config/app.php., (*4)

'providers' => [

  // ...

  Orchestra\Memory\MemoryServiceProvider::class,

],

Aliases

You might want to add Orchestra\Support\Facades\Memory to class aliases in config/app.php:, (*5)

'aliases' => [

  // ...

  'Memory' => Orchestra\Support\Facades\Memory::class,

],

Migrations

Before we can start using Memory Component, please run the following:, (*6)

php artisan migrate, (*7)

Publish Configuration

Optionally, you can also publish the configuration file if there any requirement to change the default:, (*8)

php artisan vendor:publish --provider="Orchestra\\Memory\\MemoryServiceProvider"

Usage

Creating Instance

Below are list of possible ways to use Memory Component:, (*9)

$runtime  = Memory::make('runtime');
$fluent   = Memory::make('fluent');
$eloquent = Memory::make('eloquent');
$cache    = Memory::make('cache');

However, most of the time you wouldn't need to have additional memory instance other than the default which is using orchestra_options table., (*10)

$memory = Memory::make();

When using with Orchestra Platform, Memory::make() would be used throughout the application., (*11)

Storing Items

Storing items in the Memory Component is simple. Simply call the put method:, (*12)

$memory->put('site.author', 'Taylor');

// or you can also use
Memory::put('site.author', 'Taylor');

The first parameter is the key to the config item. You will use this key to retrieve the item from the config. The second parameter is the value of the item., (*13)

Retrieving Items

Retrieving items from Memory Component is even more simple than storing them. It is done using the get method. Just mention the key of the item you wish to retrieve:, (*14)

$name = $memory->get('site.author');

// or you can also use
$name = Memory::get('site.author');

By default, NULL will be returned if the item does not exist. However, you may pass a different default value as a second parameter to the method:, (*15)

$name = $memory->get('site.author', 'Fred');

Now, "Fred" will be returned if the "site.author" item does not exist., (*16)

Removing Items

Need to get rid of an item? No problem. Just mention the name of the item to the forget method:, (*17)

$memory->forget('site.author');

// or you can also use
Memory::forget('site.author');

Extending Memory

There might be requirement that a different type of storage engine would be use for memory instance, you can extending it by adding your own handler., (*18)

<?php

use Orchestra\Contracts\Memory\Handler;

class AcmeMemoryHandler implements Handler
{
  // Add your implementation
}

Memory::extend('acme', function ($app, $name) {
  return new Orchestra\Memory\Provider(
    new AcmeMemoryHandler($name)
  );
});

// Now you can use it as
$acme = Memory::make('acme.default');

You can also extends Orchestra\Memory\Handler which add some boilerplate code on your custom handler., (*19)

The Versions

31/07 2018

dev-master

9999999-dev http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

31/07 2018

3.7.x-dev

3.7.9999999.9999999-dev http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

31/07 2018

3.6.x-dev

3.6.9999999.9999999-dev http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

02/05 2018

v3.6.1

3.6.1.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

25/03 2018

3.5.x-dev

3.5.9999999.9999999-dev http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

20/02 2018

v3.6.0

3.6.0.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

25/08 2017

v3.5.0

3.5.0.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

04/07 2017

3.4.x-dev

3.4.9999999.9999999-dev http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

22/01 2017

v3.4.0

3.4.0.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

01/01 2017

3.3.x-dev

3.3.9999999.9999999-dev http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

25/06 2016

v3.3.1

3.3.1.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

11/06 2016

v3.3.0

3.3.0.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

17/03 2016

3.2.x-dev

3.2.9999999.9999999-dev http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

17/03 2016

v3.2.4

3.2.4.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

10/03 2016

v3.2.3

3.2.3.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

10/03 2016

3.1.x-dev

3.1.9999999.9999999-dev http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

10/03 2016

3.0.x-dev

3.0.9999999.9999999-dev http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

13/02 2016

v3.2.2

3.2.2.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

13/02 2016

v3.1.3

3.1.3.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

13/02 2016

v3.0.6

3.0.6.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

28/12 2015

v3.2.1

3.2.1.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

28/12 2015

v3.1.2

3.1.2.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

20/12 2015

v3.2.0

3.2.0.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

16/06 2015

v3.1.1

3.1.1.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

18/05 2015

v3.1.0

3.1.0.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

31/03 2015

v3.0.5

3.0.5.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

18/03 2015

v3.0.4

3.0.4.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

18/03 2015

v3.0.3

3.0.3.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

18/03 2015

v3.0.2

3.0.2.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

09/03 2015

v3.0.1

3.0.1.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

28/02 2015

2.2.x-dev

2.2.9999999.9999999-dev http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform 2

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

28/02 2015

2.1.x-dev

2.1.9999999.9999999-dev http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform 2

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

05/02 2015

v3.0.0

3.0.0.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

02/08 2014

v2.2.2

2.2.2.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform 2

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

02/08 2014

v2.1.6

2.1.6.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform 2

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

25/07 2014

v2.2.1

2.2.1.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform 2

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

25/07 2014

v2.1.5

2.1.5.0 http://orchestraplatform.com/docs/latest/components/memory/

Memory Component for Orchestra Platform 2

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel config orchestral orchestra-platform database-config

16/05 2014

v2.2.0

2.2.0.0 http://orchestraplatform.com/docs/latest/components/memory/

Orchestra Platform 2 Memory Component

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel orchestral orchestra-platform

04/03 2014

v2.1.4

2.1.4.0 http://orchestraplatform.com/docs/latest/components/memory/

Orchestra Platform 2 Memory Component

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel orchestral orchestra-platform

19/01 2014

v2.1.3

2.1.3.0 http://orchestraplatform.com/docs/latest/components/memory/

Orchestra Platform 2 Memory Component

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel orchestral orchestra-platform

16/01 2014

v2.1.2

2.1.2.0 http://orchestraplatform.com/docs/latest/components/memory/

Orchestra Platform 2 Memory Component

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel orchestral orchestra-platform

11/01 2014

v2.1.1

2.1.1.0 http://orchestraplatform.com/docs/latest/components/memory/

Orchestra Platform 2 Memory Component

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel orchestral orchestra-platform

03/01 2014

v2.1.0

2.1.0.0 http://orchestraplatform.com/docs/latest/components/memory/

Orchestra Platform 2 Memory Component

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel orchestral orchestra-platform

10/12 2013

2.0.x-dev

2.0.9999999.9999999-dev http://orchestraplatform.com/docs/2.0/components/memory/

Orchestra Platform 2 Memory Component

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel orchestral orchestra-platform

23/11 2013

v2.0.5

2.0.5.0 http://orchestraplatform.com/docs/2.0/components/memory/

Orchestra Platform 2 Memory Component

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel orchestral orchestra-platform

21/10 2013

v2.0.4

2.0.4.0 http://orchestraplatform.com/docs/2.0/components/memory/

Orchestra Platform 2 Memory Component

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel orchestral orchestra-platform

20/09 2013

v2.0.3

2.0.3.0 http://orchestraplatform.com/docs/2.0/components/memory/

Orchestra Platform 2 Memory Component

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel orchestral orchestra-platform

19/07 2013

v2.0.2

2.0.2.0 http://orchestraplatform.com/docs/2.0/components/memory/

Orchestra Platform 2 Memory Component

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel orchestral orchestra-platform

22/06 2013

v2.0.1

2.0.1.0 http://orchestraplatform.com/docs/2.0/components/memory/

Orchestra Platform 2 Memory Component

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel orchestral orchestra-platform

19/06 2013

v2.0.0

2.0.0.0 http://orchestraplatform.com/docs/2.0/components/memory/

Orchestra Platform 2 Memory Component

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel orchestral orchestra-platform