Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)... "

Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)... "

Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/simple_question.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)... "

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand Down
5 changes: 3 additions & 2 deletions docs/examples/SaveMultiple.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/cassandra.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/

use Phpfastcache\CacheManager;
use Phpfastcache\Drivers\Cassandra\Config;

// Include composer autoloader
require __DIR__ . '/../../vendor/autoload.php';
Expand All @@ -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
Expand Down
12 changes: 4 additions & 8 deletions docs/examples/couchbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions docs/examples/couchdb.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@
*/

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' => '/',
'username' => 'your-couchdb-username',
'password' => 'your-couchdb-password',
'ssl' => true,
'timeout' => 10,
]);
]));

/**
* Try to get $products from Caching First
Expand Down
5 changes: 3 additions & 2 deletions docs/examples/files.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
5 changes: 3 additions & 2 deletions docs/examples/leveldb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
11 changes: 5 additions & 6 deletions docs/examples/memcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 3 additions & 4 deletions docs/examples/memcached.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions docs/examples/predis.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions docs/examples/redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/riak.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/

use Phpfastcache\CacheManager;
use Phpfastcache\Drivers\Riak\Config;

// Include composer autoloader
require __DIR__ . '/../../vendor/autoload.php';
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions docs/examples/sqlite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down