2017 © Pedro Peláez
 

library context

PHP single context. Key value store in current context.

image

arifmahmudrana/context

PHP single context. Key value store in current context.

  • Saturday, May 13, 2017
  • by arifmahmudrana
  • Repository
  • 1 Watchers
  • 3 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHP Context(Key Value Data Store)

Build Status, (*1)

This is nothing but a key value store in the current context. You store value & in other places you retrieve value by it's key., (*2)

Usage

Step 1: Install Through Composer

composer require arifmahmudrana/context

and that's it., (*3)

Examples

Set Value

use ArifMahmudRana\Context\ContextContainer;

ContextContainer::set('user', User::find(1))//Save user Returns true

Get Value

use ArifMahmudRana\Context\ContextContainer;

ContextContainer::get('user')//Get user

Has Value

use ArifMahmudRana\Context\ContextContainer;

ContextContainer::has('user')//Return true

All Value

use ArifMahmudRana\Context\ContextContainer;

ContextContainer::all()//Returns key value ['user' => User Object] default empty array

Remove Value

use ArifMahmudRana\Context\ContextContainer;

ContextContainer::remove('user')//Returns true removes the key

Important

  1. You can't instantiate this class if tried it will throw CannotInstantiateClassExceptions exception
  2. You can use only string as key else it will throw \InvalidArgumentException exception

Tests

To Run the tests, (*4)

./vendor/bin/phpunit //run phpunit

Contributing

All contributions are welcome, for any bug, issue or merge request please refer to CONTRIBUTING.md, (*5)

License

Released under the MIT License, see LICENSE., (*6)

The Versions

13/05 2017

dev-master

9999999-dev https://github.com/arifmahmudrana/context

PHP single context. Key value store in current context.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Arif Mahmud Rana

laravel framework symfony

05/02 2017

v1.0.0

1.0.0.0 https://github.com/arifmahmudrana/context

PHP single context. Key value store in current context.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Arif Mahmud Rana

laravel framework symfony