From ca1e93b7e7d25db581ef6afee316a17f83a80ac3 Mon Sep 17 00:00:00 2001 From: Khoa Bui Date: Sun, 3 Apr 2016 13:28:26 -0700 Subject: [PATCH 1/4] 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 ea8945d9942b37904abdaa770bdec07de92964a1 Mon Sep 17 00:00:00 2001 From: Khoa Bui Date: Sun, 3 Apr 2016 13:32:04 -0700 Subject: [PATCH 2/4] 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 54589877ac1b91435025528f61d43065f7a8829b Mon Sep 17 00:00:00 2001 From: Khoa Bui Date: Sun, 3 Apr 2016 13:47:10 -0700 Subject: [PATCH 3/4] 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 0340e92d83200923b60cb9e3bf5dbaad90b8ac9a Mon Sep 17 00:00:00 2001 From: Khoa Bui Date: Sun, 3 Apr 2016 13:47:30 -0700 Subject: [PATCH 4/4] 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: