Package Data | |
---|---|
Maintainer Username: | bpartner |
Maintainer Contact: | azinchenko@bpartner.com.ua (Alexander Zinchenko) |
Package Create Date: | 2019-01-07 |
Package Last Update: | 2019-06-21 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-19 03:18:04 |
Package Statistics | |
---|---|
Total Downloads: | 40 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Save global variables as an array and access this array from anywhere in the program.
An interface is provided for implementing storage on disk or in a database, such as a sqlite.
$ composer require bpartner/storage
Save variable
<?php
use Bpartner\Storage\StorageInMemory;
$key = 'user';
$value = [
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'jdoe@mail.com'
];
StorageInMemory::setParam($key, $value);
Get variable
<?php
use Bpartner\Storage\StorageInMemory;
$user = StorageInMemory::getParam('user');
echo $user['first_name'];