@@ -55,4 +55,4 @@ |
||
55 | 55 | echo '<br /><br /><a href="/">Back to index</a> -- <a href="/' . basename(__FILE__) . '">Reload</a>'; |
56 | 56 | |
57 | 57 | // Testing Functions |
58 | -require_once __DIR__."/TestingFunctions.php"; |
|
59 | 58 | \ No newline at end of file |
59 | +require_once __DIR__ . "/TestingFunctions.php"; |
|
60 | 60 | \ No newline at end of file |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | |
37 | 37 | $keyword1 = "my_apple_keyword"; |
38 | 38 | $value1 = "Apple is good"; |
39 | -$cache->set($keyword1,$value1); |
|
39 | +$cache->set($keyword1, $value1); |
|
40 | 40 | |
41 | 41 | |
42 | 42 | $keyword2 = "my_iphone_keyword"; |
43 | 43 | $value2 = "Android is better than iphone for sure"; |
44 | -$cache->set($keyword2,$value2); |
|
44 | +$cache->set($keyword2, $value2); |
|
45 | 45 | |
46 | 46 | |
47 | 47 | /// Time for the magic |
@@ -86,4 +86,4 @@ discard block |
||
86 | 86 | echo "<hr>"; |
87 | 87 | echo "<b>Testing Tags:</b>"; |
88 | 88 | |
89 | -include_once __DIR__."/Tags.YourCaching.php"; |
|
90 | 89 | \ No newline at end of file |
90 | +include_once __DIR__ . "/Tags.YourCaching.php"; |
|
91 | 91 | \ No newline at end of file |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | // You can also pass the setup directly to cache |
50 | 50 | $cache = CacheManager::Files($config); |
51 | -$cache = CacheManager::getInstance("Files",$config); |
|
51 | +$cache = CacheManager::getInstance("Files", $config); |
|
52 | 52 | |
53 | 53 | /************************************************** |
54 | 54 | * Overwrite Caching Driver |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | CacheManager::setup($config); |
65 | 65 | |
66 | 66 | $cache = CacheManager::getInstance(); // return Files Cache |
67 | -$cache_memcache = CacheManager::Memcached(); // return Files Cache |
|
68 | -$cache_apc = CacheManager::Apc(); // return Files Cache |
|
69 | -$cache_redis = CacheManager::Redis(); // return Files Cache |
|
67 | +$cache_memcache = CacheManager::Memcached(); // return Files Cache |
|
68 | +$cache_apc = CacheManager::Apc(); // return Files Cache |
|
69 | +$cache_redis = CacheManager::Redis(); // return Files Cache |
|
70 | 70 | |
71 | 71 | |
72 | 72 |
@@ -8,14 +8,14 @@ |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | // In your Setting / Config.php or Index.php |
11 | - define("PHPFASTCACHE_LEGACY",true); |
|
11 | + define("PHPFASTCACHE_LEGACY", true); |
|
12 | 12 | |
13 | 13 | // If you use composer, then it auto included our "src/phpFastCache/phpFastCache.php" on vendor folder already, you don't need to do anything else |
14 | 14 | |
15 | - require_once __DIR__.'/../src/autoload.php'; |
|
15 | + require_once __DIR__ . '/../src/autoload.php'; |
|
16 | 16 | |
17 | 17 | // run Files Example |
18 | - require_once __DIR__.'/files.php'; |
|
18 | + require_once __DIR__ . '/files.php'; |
|
19 | 19 | |
20 | 20 | /* |
21 | 21 | * It also bring back the __c() legacy function |
@@ -40,17 +40,17 @@ discard block |
||
40 | 40 | |
41 | 41 | $keyword1 = "my_apple_keyword"; |
42 | 42 | $value1 = "Apple is good"; |
43 | -$cache->set($keyword1,$value1, 300, array("tags" => array("apple","laptop","computer"))); |
|
43 | +$cache->set($keyword1, $value1, 300, array("tags" => array("apple", "laptop", "computer"))); |
|
44 | 44 | // OR: $cache->setTags($keyword1,$value1,300, array("computer","laptop")); |
45 | 45 | |
46 | 46 | |
47 | 47 | $keyword2 = "my_iphone_keyword"; |
48 | 48 | $value2 = "Android is better than iphone for sure"; |
49 | -$cache->setTags($keyword2,$value2, 800, array("apple","cellphone")); |
|
49 | +$cache->setTags($keyword2, $value2, 800, array("apple", "cellphone")); |
|
50 | 50 | |
51 | 51 | |
52 | 52 | /// Time for the magic |
53 | -$myAppleProducts = $cache->getTags(array("apple","laptop")); |
|
53 | +$myAppleProducts = $cache->getTags(array("apple", "laptop")); |
|
54 | 54 | echo "<pre>"; |
55 | 55 | print_r($myAppleProducts); |
56 | 56 | echo "</pre>"; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | |
82 | 82 | /// Just need Keywords & Expired Time, No Caching Contents => put false at end |
83 | -$myAppleProducts = $cache->getTags(array("apple","laptop"), false); |
|
83 | +$myAppleProducts = $cache->getTags(array("apple", "laptop"), false); |
|
84 | 84 | echo "<pre>"; |
85 | 85 | print_r($myAppleProducts); |
86 | 86 | echo "</pre>"; |
@@ -58,4 +58,4 @@ |
||
58 | 58 | echo '<br /><br /><a href="/">Back to index</a> -- <a href="/' . basename(__FILE__) . '">Reload</a>'; |
59 | 59 | |
60 | 60 | // Testing Functions |
61 | -require_once __DIR__."/TestingFunctions.php"; |
|
61 | +require_once __DIR__ . "/TestingFunctions.php"; |
@@ -14,7 +14,7 @@ |
||
14 | 14 | $cache = phpFastCache("redis"); |
15 | 15 | |
16 | 16 | if ($cache->fallback === true) { |
17 | - echo " USE BACK UP DRIVER = " . phpFastCache::$config[ 'fallback' ] . " <br>"; |
|
17 | + echo " USE BACK UP DRIVER = " . phpFastCache::$config['fallback'] . " <br>"; |
|
18 | 18 | } else { |
19 | 19 | echo ' DRIVER IS GOOD <br>'; |
20 | 20 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | // Include composer autoloader |
6 | 6 | require '../src/autoload.php'; |
7 | 7 | |
8 | -if(!isset($InstanceCache)) { |
|
8 | +if (!isset($InstanceCache)) { |
|
9 | 9 | $InstanceCache = CacheManager::getInstance(); |
10 | 10 | } |
11 | 11 | |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | } |
15 | 15 | |
16 | 16 | function output($string) { |
17 | - echo $string."\r\n<br>"; |
|
17 | + echo $string . "\r\n<br>"; |
|
18 | 18 | } |
19 | 19 | break_line(); |
20 | 20 | $key = "key1"; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | output("{$key} = {$value}"); |
24 | 24 | break_line(); |
25 | 25 | output("Write Data 123456"); |
26 | - $InstanceCache->set($key,"123456",300); |
|
26 | + $InstanceCache->set($key, "123456", 300); |
|
27 | 27 | break_line(); |
28 | 28 | output("Read Data Again"); |
29 | 29 | $value = $InstanceCache->get($key); |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | output("{$key} = {$value}"); |
36 | 36 | break_line(); |
37 | 37 | output("Write Data 100"); |
38 | -$InstanceCache->set($key,100,300); |
|
38 | +$InstanceCache->set($key, 100, 300); |
|
39 | 39 | output("Increase by 10"); |
40 | -$InstanceCache->increment($key,10); |
|
40 | +$InstanceCache->increment($key, 10); |
|
41 | 41 | $value = $InstanceCache->get($key); |
42 | 42 | output("{$key} = {$value}"); |
43 | 43 | output("Decrease by 10"); |
44 | -$InstanceCache->decrement($key,10); |
|
44 | +$InstanceCache->decrement($key, 10); |
|
45 | 45 | $value = $InstanceCache->get($key); |
46 | 46 | output("{$key} = {$value}"); |
47 | 47 | break_line(); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | // Include composer autoloader |
24 | 24 | require '../src/autoload.php'; |
25 | 25 | |
26 | -CacheManager::setup("storage","sqlite"); |
|
26 | +CacheManager::setup("storage", "sqlite"); |
|
27 | 27 | |
28 | 28 | $InstanceCache = CacheManager::getInstance(); |
29 | 29 |