From fe258dfbf4c29fca87b801d0e32c97cce77f81a8 Mon Sep 17 00:00:00 2001 From: Khoa Bui Date: Sun, 3 Apr 2016 13:28:26 -0700 Subject: [PATCH 1/9] Testing Functions --- examples/TestingFunctions.php | 48 +++++++++++++++++++++++++++++++++++ examples/files.php | 3 +++ examples/memcache.php | 5 +++- examples/memcached.php | 2 +- examples/phpinfo.php | 2 ++ examples/predis.php | 3 +++ 6 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 examples/TestingFunctions.php create mode 100644 examples/phpinfo.php diff --git a/examples/TestingFunctions.php b/examples/TestingFunctions.php new file mode 100644 index 000000000..8da2d61e8 --- /dev/null +++ b/examples/TestingFunctions.php @@ -0,0 +1,48 @@ +

"; +} + +function output($string) { + echo $string."\r\n
"; +} +break_line(); + $key = "key1"; + output("Test Get"); + $value = $InstanceCache->get($key); + output("{$key} = {$value}"); +break_line(); + output("Write Data 123456"); + $InstanceCache->set($key,"123456",300); +break_line(); + output("Read Data Again"); + $value = $InstanceCache->get($key); + output("{$key} = {$value}"); +break_line(); + output("Delete Key"); + $InstanceCache->delete($key); + $value = $InstanceCache->get($key); + output("{$key} = {$value}"); +break_line(); +output("Write Data 100"); +$InstanceCache->set($key,100,300); +output("Increase by 10"); +$InstanceCache->increment($key,10); +$value = $InstanceCache->get($key); +output("{$key} = {$value}"); +output("Decrease by 10"); +$InstanceCache->decrement($key,10); +$value = $InstanceCache->get($key); +output("{$key} = {$value}"); +break_line(); +output("Finished Testing, Caching is Working Good"); \ No newline at end of file diff --git a/examples/files.php b/examples/files.php index 1b82beb3d..f2a1342ed 100644 --- a/examples/files.php +++ b/examples/files.php @@ -60,3 +60,6 @@ echo '

Back to index -- Reload'; +// Testing Functions +require_once __DIR__."/TestingFunctions.php"; + diff --git a/examples/memcache.php b/examples/memcache.php index 4f0eac0de..329b2b817 100644 --- a/examples/memcache.php +++ b/examples/memcache.php @@ -21,7 +21,7 @@ use phpFastCache\CacheManager; // Include composer autoloader -require '../vendor/autoload.php'; +require '../src/autoload.php'; CacheManager::setup(array( 'memcache' => array( @@ -53,3 +53,6 @@ } echo '

Back to index -- Reload'; + +// Testing Functions +require_once __DIR__."/TestingFunctions.php"; \ No newline at end of file diff --git a/examples/memcached.php b/examples/memcached.php index bc216eb90..102c4f279 100644 --- a/examples/memcached.php +++ b/examples/memcached.php @@ -21,7 +21,7 @@ use phpFastCache\CacheManager; // Include composer autoloader -require '../vendor/autoload.php'; +require '../src/autoload.php'; CacheManager::setup(array( 'memcache' => array( diff --git a/examples/phpinfo.php b/examples/phpinfo.php new file mode 100644 index 000000000..bfd863b05 --- /dev/null +++ b/examples/phpinfo.php @@ -0,0 +1,2 @@ +
Back to index -- Reload'; + +// Testing Functions +require_once __DIR__."/TestingFunctions.php"; From 21b60e3646e33de7fe406a4656dd3b84cd2adf03 Mon Sep 17 00:00:00 2001 From: Khoa Bui Date: Sun, 3 Apr 2016 13:32:04 -0700 Subject: [PATCH 2/9] Fix Caching Test --- tests/NewCacheInstance.test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/NewCacheInstance.test.php b/tests/NewCacheInstance.test.php index 018940023..6a32c7fdf 100644 --- a/tests/NewCacheInstance.test.php +++ b/tests/NewCacheInstance.test.php @@ -16,7 +16,7 @@ /** * Testing memcached as it is declared in .travis.yml */ -$driverInstance = CacheManager::getInstance('memcached'); +$driverInstance = CacheManager::getInstance(); if(!is_object($driverInstance) || !($driverInstance instanceof DriverInterface)) { From 89daccde5d0e5edcef59546d5b1fb3e6cce50198 Mon Sep 17 00:00:00 2001 From: Khoa Bui Date: Sun, 3 Apr 2016 13:47:10 -0700 Subject: [PATCH 3/9] no nightly tmp --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6e0b2b23b..479eddb96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ php: - 5.5 - 5.6 - 7.0 - - nightly + # - nightly # - hhvm We may need to do review this check later script: From ca205ecaeedceff08d2f8f76d990b18877c779f0 Mon Sep 17 00:00:00 2001 From: Khoa Bui Date: Sun, 3 Apr 2016 13:47:30 -0700 Subject: [PATCH 4/9] Revert "no nightly tmp" This reverts commit 54589877ac1b91435025528f61d43065f7a8829b. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 479eddb96..6e0b2b23b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ php: - 5.5 - 5.6 - 7.0 - # - nightly + - nightly # - hhvm We may need to do review this check later script: From d148e4e88c7db75fae1251f4dae26ffc8148c175 Mon Sep 17 00:00:00 2001 From: Khoa Bui Date: Sun, 3 Apr 2016 13:49:12 -0700 Subject: [PATCH 5/9] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e0b2b23b..44868c38f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,10 +18,10 @@ php: - 5.5 - 5.6 - 7.0 - - nightly + # - nightly # - hhvm We may need to do review this check later script: - php -f tests/SyntaxChecker.test.php - php -f tests/Autoload.test.php - - php -f tests/NewCacheInstance.test.php \ No newline at end of file + - php -f tests/NewCacheInstance.test.php From 67d5871fc33f4e4d4a75b10cfadd36d12e2c59e8 Mon Sep 17 00:00:00 2001 From: Khoa Bui Date: Tue, 12 Apr 2016 11:00:39 -0700 Subject: [PATCH 6/9] Fix Tags & Search --- examples/Search.YourCaching.php | 7 +++++++ src/phpFastCache/Core/DriverAbstract.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/Search.YourCaching.php b/examples/Search.YourCaching.php index 2f23f9b77..d09ae5125 100644 --- a/examples/Search.YourCaching.php +++ b/examples/Search.YourCaching.php @@ -32,6 +32,8 @@ // In your class, function, you can call the Cache $cache = CacheManager::Files(); +echo "Testing Search:"; + $keyword1 = "my_apple_keyword"; $value1 = "Apple is good"; $cache->set($keyword1,$value1); @@ -80,3 +82,8 @@ [my_iphone_keyword] => Android is better than iphone for sure ) */ + +echo "
"; +echo "Testing Tags:"; + +include_once __DIR__."/Tags.YourCaching.php"; \ No newline at end of file diff --git a/src/phpFastCache/Core/DriverAbstract.php b/src/phpFastCache/Core/DriverAbstract.php index 2719cc2c5..b880401fc 100644 --- a/src/phpFastCache/Core/DriverAbstract.php +++ b/src/phpFastCache/Core/DriverAbstract.php @@ -108,7 +108,7 @@ public function set($keyword, $value = '', $time = 0, $option = array()) // handle search if (isset($this->config[ 'allow_search' ]) && $this->config[ 'allow_search' ] == true) { - $option[ 'tags' ] = array("search"); + $option[ 'tags' ][] = "search"; } // handle tags From 5cabdb80a3be7514f8c379cd181a25ec2e3a572b Mon Sep 17 00:00:00 2001 From: Seth Westphal Date: Wed, 13 Apr 2016 18:54:42 -0500 Subject: [PATCH 7/9] Adding closing tag. --- examples/phpinfo.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/phpinfo.php b/examples/phpinfo.php index bfd863b05..cf6086080 100644 --- a/examples/phpinfo.php +++ b/examples/phpinfo.php @@ -1,2 +1,3 @@ From 1fe1e346b743de61f68e9509682b3743df83b20b Mon Sep 17 00:00:00 2001 From: Seth Westphal Date: Wed, 13 Apr 2016 18:56:00 -0500 Subject: [PATCH 8/9] Fixing typo. --- src/phpFastCache/CacheManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/phpFastCache/CacheManager.php b/src/phpFastCache/CacheManager.php index a71902291..e690d48fc 100644 --- a/src/phpFastCache/CacheManager.php +++ b/src/phpFastCache/CacheManager.php @@ -96,7 +96,7 @@ public static function getInstance($storage = 'auto', $config = array()) /** * Setup Method - * @param string $string | tradtiional(normal), memory (fast), phpfastcache (fastest) + * @param string $string | traditional(normal), memory (fast), phpfastcache (fastest) */ public static function CachingMethod($string = "phpFastCache") { From 71cace489eb53adb7a1e190c7f8138088fad98a1 Mon Sep 17 00:00:00 2001 From: Thibault Date: Wed, 4 May 2016 19:23:29 +0200 Subject: [PATCH 9/9] Fixed CodeClimate crashing (cherry picked from commit 093d5cbc22dff411abc566d276d44c40a91b0702) --- .codeclimate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index 058162934..fe6fc9f06 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -38,5 +38,5 @@ ratings: - "**.php" - "**.py" - "**.rb" -exclude_paths: [] +exclude_paths: - "src/phpFastCache/_extensions/**"