Skip to content

Latest commit

 

History

History
executable file
·
30 lines (26 loc) · 549 Bytes

README.md

File metadata and controls

executable file
·
30 lines (26 loc) · 549 Bytes

LocalStorage

like html5 local storage but for php.

Installation

composer require mordisacks/localstorage

Usage

Statically

LocalStorage::set('foo', 'bar');
echo LocalStorage::get('foo'); // outputs bar

Or via instance

$localStorage = new LocalStorage();
$localStorage->foo = 'bar';
echo $localStorage->foo; // outputs bar

Use custom driver

LocalStorage::init(LocalStorageDriverInterface $driver);

And via instance

$localStorage = new LocalStorage(LocalStorageDriverInterface $driver);