Skip to content

Commit 496685c

Browse files
committed
ReadMe
1 parent 236c912 commit 496685c

File tree

2 files changed

+32
-115
lines changed

2 files changed

+32
-115
lines changed

readme/Doc Huong Dan.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---------------------------
2+
Simple Yet Powerful PHP Caching Class
3+
---------------------------
4+
More information at http://www.phpfastcache.com
5+
One Class uses for All Cache. You don't need to rewrite your code many times again.
6+
7+
Supported: Redis, Predis, Cookie, Files, MemCache, MemCached, APC, WinCache, X-Cache, PDO with SQLite
8+
9+
#################################################################################################################
10+
11+
1. Open example.php & exanple2.php for the idea of caching.
12+
2. open phpfastcache.php for config & variable.
13+
3. PUT require_once("/PATH/TO/YOUR/phpfastcache/phpfastcache.php"); on your config files like wp-config.php, init.php ...etc and you are good to go.
14+
4. Learn fast, 10 minutes only, read folder /examples/* <-- everything is here. I will update more and more examples on futures.
15+
5. IF YOU GET INTO ANY PROBLEM, TRY TO POST AT www.phpfastcache.com -> Issues , I online everyday to help and keep tracks bugs. Most of the bugs fix in 12 - 24 hours.
16+
17+
#################################################################################################################
18+
19+
IF YOU LIKE phpFastCache please SHARE it to your friends. Everyone is thanks to You.
20+
21+
^_^ Khoa. B ^_^
22+

readme/ReadMe.txt

Lines changed: 10 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -6,122 +6,17 @@ One Class uses for All Cache. You don't need to rewrite your code many times aga
66

77
Supported: Redis, Predis, Cookie, Files, MemCache, MemCached, APC, WinCache, X-Cache, PDO with SQLite
88

9-
---------------------------
10-
Reduce Database Calls
11-
12-
Your website have 10,000 visitors who are online, and your dynamic page have to send 10,000 same queries to database on every page load.
13-
With phpFastCache, your page only send 1 query to DB, and use the cache to serve 9,999 other visitors.
14-
15-
```php
16-
<?php
17-
/*
18-
* Welcome to Learn Lesson
19-
* This is very Simple PHP Code of Caching
20-
*/
21-
22-
// Require Library
23-
// Keep it Auto or setup it as "files","sqlite","wincache" ,"apc","memcache","memcached", "xcache"
24-
require_once("phpfastcache.php");
25-
phpFastCache::setup("storage","auto");
26-
// phpFastCache::setup("storage","files");
27-
// OR open phpfastcache.php and edit your config value there
28-
29-
// simple Caching with:
30-
$cache = phpFastCache();
31-
// $cache = phpFastCache("redis");
32-
33-
// Try to get $products from Caching First
34-
// product_page is "identity keyword";
35-
$products = $cache->get("product_page");
36-
37-
if($products == null) {
38-
$products = "DB QUERIES | FUNCTION_GET_PRODUCTS | ARRAY | STRING | OBJECTS";
39-
// Write products to Cache in 10 minutes with same keyword
40-
$cache->set("product_page",$products , 600);
41-
}
42-
43-
// use your products here or return it;
44-
echo $products;
45-
```
46-
---------------------------
47-
```php
48-
<?php
49-
50-
/*
51-
* List of function and example
52-
*/
53-
require_once("phpfastcache.php");
54-
$cache = phpFastCache();
55-
56-
// Write into cache
57-
$cache->set("keyword", "data | array | object", 300);
58-
$cache->set("keyword", "data | array | object"); // <-- Non-Expired Objects without Time, until you delete the cache.
59-
60-
// Read from Cache | return "null" or "data"
61-
$data = $cache->get("keyword");
62-
echo $data;
63-
64-
// Temporary disabled phpFastCache
65-
phpFastCache::$disabled = true;
66-
$data = $cache->get("keyword");
67-
echo $data; // ALWAYS RETURN NULL;
68-
69-
// Read object information | value | time from cache
70-
$object = $cache->getInfo("keyword");
71-
print_r($object);
72-
73-
// Delete from cache
74-
$cache->delete("keyword");
75-
76-
// Clean up all cache
77-
$cache->clean();
78-
79-
// Stats
80-
$array = $cache->stats();
81-
print_r($array);
82-
83-
// Increase and Decrease Cache value - Return true | false
84-
$cache->increment("keyword", 1);
85-
$cache->decrement("keyword", 1);
86-
87-
// Extend expiring time - Return true | false;
88-
$cache->touch("keyword", 1000);
89-
90-
// Check Existing or not - Return true | false;
91-
$cache->isExisting("keyword");
92-
93-
// Get & Set Multiple Items
94-
// Same as above, but input is array();
95-
96-
$list = $cache->getMulti(array("key1","key2","key3"));
97-
98-
$list = $cache->getInfoMulti(array("key1","key2","key3"));
99-
100-
$cache->setMulti(array("key1","value1", 300),
101-
array("key2","value2", 600),
102-
array("key3","value3", 1800));
103-
104-
$cache->deleteMulti(array("key1","key2","key3"));
105-
106-
$cache->isExistingMulti(array("key1","key2","key3"));
107-
108-
$cache->touchMulti(array(
109-
array("key", 300),
110-
array("key2", 400),
111-
));
112-
113-
$cache->incrementMulti(array(
114-
array("key", 1),
115-
array("key2", 2),
116-
));
117-
118-
$cache->decrementMulti(array(
119-
array("key", 1),
120-
array("key2", 2),
121-
));
122-
9+
#################################################################################################################
12310

11+
1. Open example.php & exanple2.php for the idea of caching.
12+
2. open phpfastcache.php for config & variable.
13+
3. PUT require_once("/PATH/TO/YOUR/phpfastcache/phpfastcache.php"); on your config files like wp-config.php, init.php ...etc and you are good to go.
14+
4. Learn fast, 10 minutes only, read folder /examples/* <-- everything is here. I will update more and more examples on futures.
15+
5. IF YOU GET INTO ANY PROBLEM, TRY TO POST AT www.phpfastcache.com -> Issues , I online everyday to help and keep tracks bugs. Most of the bugs fix in 12 - 24 hours.
12416

17+
#################################################################################################################
12518

19+
IF YOU LIKE phpFastCache please SHARE it to your friends. Everyone is thanks to You.
12620

127-
````
21+
^_^ Khoa. B ^_^
22+

0 commit comments

Comments
 (0)