Completed
Branch final (ed8936)
by Georges
03:54
created
examples/legacy_examples/readme_legacy.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,38 +1,38 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-	/*
3
+    /*
4 4
 	 * For Legacy Coding
5 5
 	 * You can do require_once ("phpFastCache/phpFastCache.php");
6 6
 	 * and call it right away
7 7
 	 */
8 8
 
9
-	// In your config files
9
+    // In your config files
10 10
 require_once("../../src/autoload.php");
11 11
 
12
-	// now it's time to call the cache "anywhere" on your project
12
+    // now it's time to call the cache "anywhere" on your project
13 13
 
14
-	$cache = phpFastCache();
15
-	/* phpFastCache support more drivers
14
+    $cache = phpFastCache();
15
+    /* phpFastCache support more drivers
16 16
 	$files_cache = phpFastCache("files");
17 17
 	$memcache_cache = phpFastCache("memcache");
18 18
 	*/
19 19
 
20
-	/**
21
-	 * Try to get $products from Caching First
22
-	 * product_page is "identity keyword";
23
-	 */
24
-	$key = "product_page";
25
-	$CachedString = $cache->get($key);
20
+    /**
21
+     * Try to get $products from Caching First
22
+     * product_page is "identity keyword";
23
+     */
24
+    $key = "product_page";
25
+    $CachedString = $cache->get($key);
26 26
 
27
-	if (is_null($CachedString)) {
28
-		$CachedString = "Files Cache --> Cache Enabled --> Well done !";
29
-		// Write products to Cache in 10 minutes with same keyword
30
-		$InstanceCache->set($key, $CachedString, 600);
27
+    if (is_null($CachedString)) {
28
+        $CachedString = "Files Cache --> Cache Enabled --> Well done !";
29
+        // Write products to Cache in 10 minutes with same keyword
30
+        $InstanceCache->set($key, $CachedString, 600);
31 31
 
32
-		echo "Files Cache --> Cached not enabled --> Reload page !";
32
+        echo "Files Cache --> Cached not enabled --> Reload page !";
33 33
 
34
-	} else {
35
-		echo $CachedString;
36
-	}
34
+    } else {
35
+        echo $CachedString;
36
+    }
37 37
 
38 38
 
Please login to merge, or discard this patch.
examples/legacy_examples/3.setup.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 $config = array(
14
-  "storage" => "auto", // auto, files, sqlite, apc, cookie, memcache, memcached, predis, redis, wincache, xcache
15
-  "default_chmod" => 0777, // For security, please use 0666 for module and 0644 for cgi.
14
+    "storage" => "auto", // auto, files, sqlite, apc, cookie, memcache, memcached, predis, redis, wincache, xcache
15
+    "default_chmod" => 0777, // For security, please use 0666 for module and 0644 for cgi.
16 16
 
17 17
 
18 18
     /*
@@ -22,35 +22,35 @@  discard block
 block discarded – undo
22 22
     // create .htaccess to protect cache folder
23 23
     // By default the cache folder will try to create itself outside your public_html.
24 24
     // However an htaccess also created in case.
25
-  "htaccess" => true,
25
+    "htaccess" => true,
26 26
 
27 27
     // path to cache folder, leave it blank for auto detect
28
-  "path" => "",
29
-  "securityKey" => "auto", // auto will use domain name, set it to 1 string if you use alias domain name
28
+    "path" => "",
29
+    "securityKey" => "auto", // auto will use domain name, set it to 1 string if you use alias domain name
30 30
 
31 31
     // MEMCACHE
32 32
 
33
-  "memcache" => array(
33
+    "memcache" => array(
34 34
     array("127.0.0.1", 11211, 1),
35
-      //  array("new.host.ip",11211,1),
36
-  ),
35
+        //  array("new.host.ip",11211,1),
36
+    ),
37 37
 
38 38
     // REDIS
39
-  "redis" => array(
39
+    "redis" => array(
40 40
     "host" => "127.0.0.1",
41 41
     "port" => "",
42 42
     "password" => "",
43 43
     "database" => "",
44 44
     "timeout" => "",
45
-  ),
45
+    ),
46 46
 
47
-  "extensions" => array(),
47
+    "extensions" => array(),
48 48
 
49 49
 
50 50
     /*
51 51
      * Fall back when old driver is not support
52 52
      */
53
-  "fallback" => "files",
53
+    "fallback" => "files",
54 54
 );
55 55
 
56 56
 phpFastCache::setup($config);
@@ -77,6 +77,6 @@  discard block
 block discarded – undo
77 77
 
78 78
 $cache2 = CacheManager::getInstance("memcache"); // this will use memcache
79 79
 $server = array(
80
-  array("127.0.0.1", 11211, 1),
80
+    array("127.0.0.1", 11211, 1),
81 81
 );
82 82
 $cache2->setup("memcache", $server);
83 83
\ No newline at end of file
Please login to merge, or discard this patch.
examples/legacy_examples/5.functions.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -44,26 +44,26 @@
 block discarded – undo
44 44
 $list = $cache->getInfoMulti(array("key1", "key2", "key3"));
45 45
 
46 46
 $cache->setMulti(array("key1", "value1", 300),
47
-  array("key2", "value2", 600),
48
-  array("key3", "value3", 1800));
47
+    array("key2", "value2", 600),
48
+    array("key3", "value3", 1800));
49 49
 
50 50
 $cache->deleteMulti(array("key1", "key2", "key3"));
51 51
 
52 52
 $cache->isExistingMulti(array("key1", "key2", "key3"));
53 53
 
54 54
 $cache->touchMulti(array(
55
-  array("key", 300),
56
-  array("key2", 400),
55
+    array("key", 300),
56
+    array("key2", 400),
57 57
 ));
58 58
 
59 59
 $cache->incrementMulti(array(
60
-  array("key", 1),
61
-  array("key2", 2),
60
+    array("key", 1),
61
+    array("key2", 2),
62 62
 ));
63 63
 
64 64
 $cache->decrementMulti(array(
65
-  array("key", 1),
66
-  array("key2", 2),
65
+    array("key", 1),
66
+    array("key2", 2),
67 67
 ));
68 68
 
69 69
 
Please login to merge, or discard this patch.
examples/TestingFunctions.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
examples/sqlite.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/autoload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,4 +12,4 @@
 block discarded – undo
12 12
  *
13 13
  */
14 14
 
15
-require_once __DIR__."/phpFastCache/phpFastCache.php";
16 15
\ No newline at end of file
16
+require_once __DIR__ . "/phpFastCache/phpFastCache.php";
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
src/phpFastCache/phpFastCache.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,13 +15,13 @@  discard block
 block discarded – undo
15 15
 use phpFastCache\CacheManager;
16 16
 define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
17 17
 
18
-if(!defined("PHPFASTCACHE_LEGACY")) {
18
+if (!defined("PHPFASTCACHE_LEGACY")) {
19 19
     /**
20 20
      * Register Autoload
21 21
      */
22
-    spl_autoload_register(function ($entity) {
22
+    spl_autoload_register(function($entity) {
23 23
         // Explode is faster than substr & strstr also more control
24
-        $module = explode('\\',$entity,2);
24
+        $module = explode('\\', $entity, 2);
25 25
         if ($module[0] !== 'phpFastCache') {
26 26
             /**
27 27
              * Not a part of phpFastCache file
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     });
39 39
 
40 40
 } else {
41
-    require_once __DIR__.'/Util/Legacy.php';
41
+    require_once __DIR__ . '/Util/Legacy.php';
42 42
 }
43 43
 
44 44
 /**
Please login to merge, or discard this patch.
src/phpFastCache/_extensions/predis-1.0/examples/pubsub_consumer.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
                 }
44 44
             } else {
45 45
                 echo "Received the following message from {$message->channel}:",
46
-                     PHP_EOL, "  {$message->payload}", PHP_EOL, PHP_EOL;
46
+                        PHP_EOL, "  {$message->payload}", PHP_EOL, PHP_EOL;
47 47
             }
48 48
             break;
49 49
     }
Please login to merge, or discard this patch.
src/phpFastCache/_extensions/predis-1.0/examples/session_handler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 //
26 26
 
27 27
 if (!interface_exists('SessionHandlerInterface')) {
28
-    die("ATTENTION: the session handler implemented by Predis requires PHP >= 5.4.0 ".
28
+    die("ATTENTION: the session handler implemented by Predis requires PHP >= 5.4.0 " .
29 29
         "or a polyfill for SessionHandlerInterface provided by an external package.\n");
30 30
 }
31 31
 
Please login to merge, or discard this patch.