Storable PHP makes it easy to store and retrieve some loose values with the same exact syntax as Laravel's config repository. Stored values are saved as a JSON file.
Storable is easy to install into your project. simply install Storable by using composer to pull it in and it's dependencies.
composer require thavarshan/storable
use \Storable\Store;
$store = new Store($pathToFile);
$store->set('foo', 'bar');
$store->get('foo'); // should return 'bar'.
All values will be saved as JSON in the given file. When there are no values stored, the file will be deleted. You can call the following methods on the Store
.
Storable uses PHPUnit for testing. To clone Storable into your local machine and run tests, simple open up your preferred terminal application, navigate into Storable project root directory and run the following command..
git clone git@github.com:Thavarshan/storable.git
cd storable
composer install
composer test
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Thavarshan Thayananthajothy - Initial work - Thavarshan
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details