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"; 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)) {