Skip to content

Commit e96cc7e

Browse files
committed
Renamed class
Renamed class back to Erik Giberti's original name, FileCache
1 parent d5935a4 commit e96cc7e

File tree

5 files changed

+29
-14
lines changed

5 files changed

+29
-14
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PHP Cache Class (File base)
1+
PHP FileCache Class (File base)
22
============================
33
A simple file based cache based from Erik Giberti's FileCache class. See [here](http://af-design.com/blog/2010/07/30/simple-file-based-caching-in-php/)
44

@@ -35,19 +35,19 @@ You may also edit composer.json manually then perform ```composer update```:
3535
require('vendor/autoload.php');
3636

3737
//create new instance of the class
38-
use rothkj1022\Cache;
39-
$cache = new Cache\Cache("tmp/");
38+
use rothkj1022\FileCache;
39+
$cache = new FileCache\FileCache("tmp/");
4040
```
4141

4242
### Example usage without composer
4343

4444
```php
4545
//require the class
46-
require_once("lib/Cache.php");
46+
require_once("lib/FileCache.php");
4747

4848
//create new instance of the class
49-
use rothkj1022\Cache;
50-
$cache = new Cache\Cache("tmp/");
49+
use rothkj1022\FileCache;
50+
$cache = new FileCache\FileCache("tmp/");
5151

5252
//...
5353
```
@@ -96,6 +96,10 @@ See code to see all private methods used like `Cache::_encrypt($pure_string)` et
9696

9797
## Changelog
9898

99+
### Version 2.1.1
100+
101+
* Changed: Renamed class back to Erik Giberti's original name, FileCache
102+
99103
### Version 2.1.0
100104

101105
* Added: Composer integration

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"autoload": {
2424
"psr-4": {
25-
"rothkj1022\\Cache\\": "lib"
25+
"rothkj1022\\FileCache\\": "lib"
2626
}
2727
}
2828
}

example.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

33
//require the class
4-
require_once("lib/Cache.php");
4+
require_once("lib/FileCache.php");
55

66
//create new instance of the class
7-
use rothkj1022\Cache;
8-
$cache = new Cache\Cache("tmp/");
7+
use rothkj1022\FileCache;
8+
$cache = new FileCache\FileCache("tmp/");
99

1010
$cache_key = "client_list";
1111

lib/Cache.php renamed to lib/FileCache.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
2-
namespace rothkj1022\Cache;
2+
namespace rothkj1022\FileCache;
33

44
/**
5-
* @package Cache - A simple file based cache (based from Erik Giberti's FileCache class. http://af-design.com/blog/2010/07/30/simple-file-based-caching-in-php/)
5+
* @package FileCache - A simple file based cache (based from Erik Giberti's FileCache class. http://af-design.com/blog/2010/07/30/simple-file-based-caching-in-php/)
66
* @link http://www.lodev09.com
77
* @author Erik Giberti
88
* @author Jovanni Lo
@@ -51,7 +51,7 @@
5151
*
5252
*/
5353

54-
class Cache {
54+
class FileCache {
5555

5656
/**
5757
* Value is pre-pended to the cache, should be the full path to the directory
@@ -84,7 +84,7 @@ function __construct($root = '/tmp/') {
8484
$this->root = $root;
8585
// Requires the native JSON library
8686
if (!function_exists('json_decode') || !function_exists('json_encode')) {
87-
throw new Exception('Cache needs the JSON PHP extensions.');
87+
throw new Exception('FileCache needs the JSON PHP extensions.');
8888
}
8989
}
9090

tmp/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>403 Forbidden</title>
5+
</head>
6+
<body>
7+
8+
<p>Directory access is forbidden.</p>
9+
10+
</body>
11+
</html>

0 commit comments

Comments
 (0)