Download the PHP package jameslevi/nest without Composer
On this page you can find all versions of the php package jameslevi/nest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nest
Nest
Is a simple file-based PHP caching library.
Features
- Uses PHP's opcache to cache static data.
- Create multiple cache databases.
- Easy integration with any PHP framework or use with no framework at all.
Installation
-
You can install via composer.
-
If not using any framework, paste the following code to load the autoloader in your project.
-
Import nest into your project.
-
Set the default storage path for your project.
- Set the default hash algorithm to use. The default algorithm is "md5".
Basic Example
Let us try a simple caching for database configuration.
This will generate a PHP file with the following content.
Getting Started
-
You can get values using the "get" method.
-
You can add new key-value using "add" method.
-
You can update key values using "set" method.
-
All added or updated data will be only saved unless you call the "write" method.
-
You can check if a key-value exists using "has" method.
-
You can remove a key-value using "remove" method.
-
You can return cache data as array using "toArray" method.
- You can return json formatted cache data using "toJson" method.
Using Nest Facade
-
You can return nest instance by calling a static method that defines the name of your cache database.
-
You can return key-value by providing the first argument.
-
You can update data by providingthe second argument.
-
You can add new data by calling "add" method.
- You can remove key-value using "remove" method.
Clear Cache
You can clear a cache database using "destroy" method.
You can clear all your cache database using "destroyAll" method.
Contribution
For issues, concerns and suggestions, you can email James Crisostomo via [email protected].
License
This package is an open-sourced software licensed under MIT License.