Skip to content

Commit d290030

Browse files
committed
Added improved README
1 parent 99a9cde commit d290030

File tree

1 file changed

+62
-2
lines changed

1 file changed

+62
-2
lines changed

README.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,62 @@
1-
# php-temp-cache
2-
Simple PHP caching class that uses the /tmp/ folder of a Linux system.
1+
# TempCache [![Latest Stable Version](https://poser.pugx.org/cajogos/php-temp-cache/v/stable)](https://packagist.org/packages/cajogos/php-temp-cache) [![License](https://poser.pugx.org/cajogos/php-temp-cache/license)](https://packagist.org/packages/cajogos/php-temp-cache) [![Monthly Downloads](https://poser.pugx.org/cajogos/php-temp-cache/d/monthly)](https://packagist.org/packages/cajogos/php-temp-cache)
2+
3+
A simple PHP caching class that uses the temporary files (`/tmp/`) folder of a Linux distribution.
4+
5+
## Simple to Use
6+
7+
The class has been written to be dead easy to use and should be familiar to anyone who has used any caching before. However, beware that the main aim of this cache is **not to be the fastest caching mechanism out there**, but to simplify the lives of those who just want to have a simple caching system in place to avoid hitting API limits, although from my experience it is well damn fast!
8+
9+
### Storing (put)
10+
11+
```php
12+
// $expire is time in seconds for validity.
13+
14+
TempCache::put($key, $value, $expire);
15+
```
16+
17+
### Retrieving (get)
18+
19+
```php
20+
TempCache::get($key);
21+
```
22+
23+
### Deleting (remove)
24+
25+
```php
26+
TempCache::remove($key);
27+
```
28+
29+
## Features
30+
31+
* No need to install extra plugins or PHP modules.
32+
* Works out of the box. (As long as your web server use has enough privileges).
33+
* Extremely use to implement to avoid hitting those API limits.
34+
35+
## Getting Started
36+
37+
**Warning**: You need PHP >= 5.3 to use TempCache.
38+
39+
### Using Composer
40+
41+
```javascript
42+
{
43+
"require": {
44+
"cajogos/php-temp-cache": "1.0"
45+
}
46+
}
47+
```
48+
49+
### Download and use
50+
51+
The class is **self-contained** so you can use it in any project you already have by using:
52+
53+
```php
54+
require_once 'classes/TempCache.php';
55+
```
56+
57+
## Contributors
58+
- [Carlos Ferreira](https://github.com/cajogos)
59+
60+
Want to help contribute or thank me? Get in touch via <c@rlos.rocks>.
61+
62+
_You are awesome!_

0 commit comments

Comments
 (0)