-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from sarahman/master
README.md file has been created. @sarahman great. Thank you.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## Simple Cache Client Adapter ## | ||
PHP Cache library built by PSR-16 simple cache interface | ||
|
||
You can find implementations of the specification by looking for packages providing the psr/simple-cache-implementation virtual package. | ||
|
||
#### Installation | ||
- Run this command: `composer require previewtechs/simple-cache:dev-master` | ||
|
||
#### Usages | ||
- Create a file named `test.php` in your root directory and add these following codes: | ||
```php | ||
<?php | ||
|
||
require "vendor/autoload.php"; | ||
|
||
$cache = new Memcached(); | ||
$cache->addServers([ | ||
['localhost', 11211, 1] | ||
]); | ||
|
||
$cache = new Previewtechs\SimpleCache\Memcached($cache); | ||
|
||
// Set Cache key. | ||
$data = [ | ||
'sample' => 'data', | ||
'another' => 'data' | ||
]; | ||
|
||
$cache->set('your_custom_key', $data); | ||
|
||
// Check cached key exists or not. | ||
$cache->has('your_custom_key'); | ||
|
||
// Get Cached key data. | ||
$cache->get('your_custom_key'); | ||
|
||
``` | ||
- then run `php test.php` | ||
|
||
#### For Documentations | ||
[psr/simple-cache-implementation](https://packagist.org/providers/psr/simple-cache-implementation) |
f37ac50
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shahariaazam welcome, brother.