diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 47013c407..e93184a3a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -5,8 +5,8 @@ about: Create a report to help us improve Phpfastcache --- **Configuration** -- **PhpFastCache version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::GetVersion()`)..." -- **PhpFastCache API version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::getPhpFastCacheVersion()`)..." +- **PhpFastCache version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::getPhpFastCacheVersion()`)..." +- **PhpFastCache API version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::GetVersion()`)..." - **PHP version:** "...replace me (Can be retrieved using command line `php -v | sed -n 1p`)..." - **Operating system:** " ...replace me (You REALLY should know it)... " diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index e3af36743..a455f9705 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -5,8 +5,8 @@ about: Suggest an idea for Phpfastcache --- **Configuration** -- **PhpFastCache version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::GetVersion()`)..." -- **PhpFastCache API version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::getPhpFastCacheVersion()`)..." +- **PhpFastCache version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::getPhpFastCacheVersion()`)..." +- **PhpFastCache API version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::GetVersion()`)..." - **PHP version:** "...replace me (Can be retrieved using command line `php -v | sed -n 1p`)..." - **Operating system:** " ...replace me (You REALLY should know it)... " diff --git a/.github/ISSUE_TEMPLATE/simple_question.md b/.github/ISSUE_TEMPLATE/simple_question.md index b4e45fdf4..94baf8fca 100644 --- a/.github/ISSUE_TEMPLATE/simple_question.md +++ b/.github/ISSUE_TEMPLATE/simple_question.md @@ -5,8 +5,8 @@ about: Ask a question about Phpfastcache --- **Configuration (optional)** -- **PhpFastCache version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::GetVersion()`)..." -- **PhpFastCache API version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::getPhpFastCacheVersion()`)..." +- **PhpFastCache version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::getPhpFastCacheVersion()`)..." +- **PhpFastCache API version:** "...replace me (Can be retrieved using method `\Phpfastcache\Api::GetVersion()`)..." - **PHP version:** "...replace me (Can be retrieved using command line `php -v | sed -n 1p`)..." - **Operating system:** " ...replace me (You REALLY should know it)... " diff --git a/composer.json b/composer.json index 7a85584f0..dc539e279 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ } ], "require": { - "php": "^7.0 || ^7.1 || ^7.2", + "php": ">=7.0", "psr/cache": "~1.0.0", "psr/simple-cache": "~1.0.0", "ext-mbstring": "*", diff --git a/docs/examples/SaveMultiple.php b/docs/examples/SaveMultiple.php index d8a86cbc8..d7bda3cd5 100644 --- a/docs/examples/SaveMultiple.php +++ b/docs/examples/SaveMultiple.php @@ -16,11 +16,12 @@ // OR require_once("../src/phpFastCache/phpFastCache.php"); use Phpfastcache\CacheManager; +use Phpfastcache\Config\Config; // Setup File Path on your config files -CacheManager::setDefaultConfig([ +CacheManager::setDefaultConfig(new Config([ "path" => sys_get_temp_dir() -]); +])); // In your class, function, you can call the Cache $InstanceCache = CacheManager::getInstance('files'); diff --git a/docs/examples/cassandra.php b/docs/examples/cassandra.php index 9e7df6e59..e27ec6ca3 100644 --- a/docs/examples/cassandra.php +++ b/docs/examples/cassandra.php @@ -13,6 +13,7 @@ */ use Phpfastcache\CacheManager; +use Phpfastcache\Drivers\Cassandra\Config; // Include composer autoloader require __DIR__ . '/../../vendor/autoload.php'; @@ -26,7 +27,7 @@ $config['sslEnabled'] = false; $config['sslVerify'] = false; -$InstanceCache = CacheManager::getInstance('cassandra', $config); +$InstanceCache = CacheManager::getInstance('cassandra', new Config($config)); /** * Try to get $products from Caching First diff --git a/docs/examples/couchbase.php b/docs/examples/couchbase.php index 4e515d778..0a7b23ed6 100644 --- a/docs/examples/couchbase.php +++ b/docs/examples/couchbase.php @@ -13,22 +13,18 @@ */ use Phpfastcache\CacheManager; +use Phpfastcache\Drivers\Couchbase\Config; // Include composer autoloader require __DIR__ . '/../../vendor/autoload.php'; -$InstanceCache = CacheManager::getInstance('couchbase', [ +$InstanceCache = CacheManager::getInstance('couchbase', new Config([ 'host' => 'your-couchbase-host', 'port' => '8091', 'username' => 'your-couchbase-username', 'password' => 'your-couchbase-password', - 'buckets' => [ - [ - 'bucket' => 'default', // The bucket name, generally "default" by default - 'password' => '' // The bucket password if there is - ], - ] -]); + 'bucketName' => 'default' // The bucket name, generally "default" by default +])); /** * Try to get $products from Caching First diff --git a/docs/examples/couchdb.php b/docs/examples/couchdb.php index d9ca201f4..d82fbf012 100644 --- a/docs/examples/couchdb.php +++ b/docs/examples/couchdb.php @@ -13,11 +13,12 @@ */ use Phpfastcache\CacheManager; +use Phpfastcache\Drivers\Couchdb\Config; // Include composer autoloader require __DIR__ . '/../../vendor/autoload.php'; -$InstanceCache = CacheManager::getInstance('couchdb', [ +$InstanceCache = CacheManager::getInstance('couchdb', new Config([ 'host' => '127.0.0.1', 'port' => 5984, 'path' => '/', @@ -25,7 +26,7 @@ 'password' => 'your-couchdb-password', 'ssl' => true, 'timeout' => 10, -]); +])); /** * Try to get $products from Caching First diff --git a/docs/examples/files.php b/docs/examples/files.php index 63ee314fb..be3aa2b59 100644 --- a/docs/examples/files.php +++ b/docs/examples/files.php @@ -18,13 +18,14 @@ use Phpfastcache\CacheManager; +use Phpfastcache\Config\Config; use Phpfastcache\Core\phpFastCache; // Setup File Path on your config files -CacheManager::setDefaultConfig([ +CacheManager::setDefaultConfig(new Config([ "path" => sys_get_temp_dir(), "itemDetailedDate" => false -]); +])); // In your class, function, you can call the Cache $InstanceCache = CacheManager::getInstance('files'); diff --git a/docs/examples/leveldb.php b/docs/examples/leveldb.php index c294c7959..f3f2a2104 100644 --- a/docs/examples/leveldb.php +++ b/docs/examples/leveldb.php @@ -18,12 +18,13 @@ use Phpfastcache\CacheManager; +use Phpfastcache\Config\Config; use Phpfastcache\Core\phpFastCache; // Setup File Path on your config files -CacheManager::setDefaultConfig([ +CacheManager::setDefaultConfig(new Config([ "path" => sys_get_temp_dir(), -]); +])); // In your class, function, you can call the Cache $InstanceCache = CacheManager::getInstance('leveldb'); diff --git a/docs/examples/memcache.php b/docs/examples/memcache.php index ebc79d0dd..bea09dcf5 100644 --- a/docs/examples/memcache.php +++ b/docs/examples/memcache.php @@ -13,18 +13,17 @@ */ use Phpfastcache\CacheManager; +use Phpfastcache\Drivers\Memcache\Config; // Include composer autoloader require __DIR__ . '/../../src/autoload.php'; -$InstanceCache = CacheManager::getInstance('memcache', ['servers' => [ - [ +$InstanceCache = CacheManager::getInstance('memcache',new Config([ 'host' =>'127.0.0.1', 'port' => 11211, - // 'sasl_user' => false, // optional - // 'sasl_password' => false // optional - ], -]]); + // 'sasl_user' => false, // optional + // 'sasl_password' => false // optional +])); /** * In case you need to enable compress_data option: diff --git a/docs/examples/memcached.php b/docs/examples/memcached.php index f57c85f1a..d93e2966c 100644 --- a/docs/examples/memcached.php +++ b/docs/examples/memcached.php @@ -13,18 +13,17 @@ */ use Phpfastcache\CacheManager; +use Phpfastcache\Drivers\Memcached\Config; // Include composer autoloader require __DIR__ . '/../../vendor/autoload.php'; -$InstanceCache = CacheManager::getInstance('memcached', ['servers' => [ - [ +$InstanceCache = CacheManager::getInstance('memcached', new Config([ 'host' =>'127.0.0.1', 'port' => 11211, // 'sasl_user' => false, // optional // 'sasl_password' => false // optional - ], -]]); +])); /** * In case you need SASL authentication: diff --git a/docs/examples/predis.php b/docs/examples/predis.php index 21e480bf5..3e9aaffbe 100644 --- a/docs/examples/predis.php +++ b/docs/examples/predis.php @@ -13,16 +13,17 @@ */ use Phpfastcache\CacheManager; +use Phpfastcache\Drivers\Predis\Config; // Include composer autoloader require __DIR__ . '/../../vendor/autoload.php'; -$InstanceCache = CacheManager::getInstance('predis', [ +$InstanceCache = CacheManager::getInstance('predis', new Config([ 'host' => '127.0.0.1', //Default value 'port' => 6379, //Default value 'password' => null, //Default value 'database' => null, //Default value -]); +])); /** * Try to get $products from Caching First diff --git a/docs/examples/redis.php b/docs/examples/redis.php index a8b267107..aea1b93c2 100644 --- a/docs/examples/redis.php +++ b/docs/examples/redis.php @@ -13,16 +13,17 @@ */ use Phpfastcache\CacheManager; +use Phpfastcache\Drivers\Redis\Config; // Include composer autoloader require __DIR__ . '/../../vendor/autoload.php'; -$InstanceCache = CacheManager::getInstance('redis', [ +$InstanceCache = CacheManager::getInstance('redis', new Config([ 'host' => '127.0.0.1', //Default value 'port' => 6379, //Default value 'password' => null, //Default value 'database' => null, //Default value -]); +])); /** * Try to get $products from Caching First diff --git a/docs/examples/riak.php b/docs/examples/riak.php index 3de651c13..b0e0b8b62 100644 --- a/docs/examples/riak.php +++ b/docs/examples/riak.php @@ -13,6 +13,7 @@ */ use Phpfastcache\CacheManager; +use Phpfastcache\Drivers\Riak\Config; // Include composer autoloader require __DIR__ . '/../../vendor/autoload.php'; @@ -23,7 +24,7 @@ $config['prefix'] = 'riak'; $config['bucketName'] = 'phpfastcache'; -$InstanceCache = CacheManager::getInstance('riak', $config); +$InstanceCache = CacheManager::getInstance('riak', new Config($config)); /** * Try to get $products from Caching First diff --git a/docs/examples/sqlite.php b/docs/examples/sqlite.php index ee990a682..d4d1a0611 100644 --- a/docs/examples/sqlite.php +++ b/docs/examples/sqlite.php @@ -19,12 +19,13 @@ use Phpfastcache\CacheManager; +use Phpfastcache\Config\Config; use Phpfastcache\Core\phpFastCache; // Setup File Path on your config files -CacheManager::setDefaultConfig([ +CacheManager::setDefaultConfig(new Config([ "path" => sys_get_temp_dir(), -]); +])); // In your class, function, you can call the Cache $InstanceCache = CacheManager::getInstance('sqlite');