File tree Expand file tree Collapse file tree 12 files changed +37
-34
lines changed Expand file tree Collapse file tree 12 files changed +37
-34
lines changed Original file line number Diff line number Diff line change 1616// OR require_once("../src/phpFastCache/phpFastCache.php");
1717
1818use Phpfastcache \CacheManager ;
19+ use Phpfastcache \Config \Config ;
1920
2021// Setup File Path on your config files
21- CacheManager::setDefaultConfig ([
22+ CacheManager::setDefaultConfig (new Config ( [
2223 "path " => sys_get_temp_dir ()
23- ]);
24+ ])) ;
2425
2526// In your class, function, you can call the Cache
2627$ InstanceCache = CacheManager::getInstance ('files ' );
Original file line number Diff line number Diff line change 1313 */
1414
1515use Phpfastcache \CacheManager ;
16+ use Phpfastcache \Drivers \Cassandra \Config ;
1617
1718// Include composer autoloader
1819require __DIR__ . '/../../vendor/autoload.php ' ;
2627$ config ['sslEnabled ' ] = false ;
2728$ config ['sslVerify ' ] = false ;
2829
29- $ InstanceCache = CacheManager::getInstance ('cassandra ' , $ config );
30+ $ InstanceCache = CacheManager::getInstance ('cassandra ' , new Config ( $ config) );
3031
3132/**
3233 * Try to get $products from Caching First
Original file line number Diff line number Diff line change 1313 */
1414
1515use Phpfastcache \CacheManager ;
16+ use Phpfastcache \Drivers \Couchbase \Config ;
1617
1718// Include composer autoloader
1819require __DIR__ . '/../../vendor/autoload.php ' ;
1920
20- $ InstanceCache = CacheManager::getInstance ('couchbase ' , [
21+ $ InstanceCache = CacheManager::getInstance ('couchbase ' , new Config ( [
2122 'host ' => 'your-couchbase-host ' ,
2223 'port ' => '8091 ' ,
2324 'username ' => 'your-couchbase-username ' ,
2425 'password ' => 'your-couchbase-password ' ,
25- 'buckets ' => [
26- [
27- 'bucket ' => 'default ' , // The bucket name, generally "default" by default
28- 'password ' => '' // The bucket password if there is
29- ],
30- ]
31- ]);
26+ 'bucketName ' => 'default ' // The bucket name, generally "default" by default
27+ ]));
3228
3329/**
3430 * Try to get $products from Caching First
Original file line number Diff line number Diff line change 1313 */
1414
1515use Phpfastcache \CacheManager ;
16+ use Phpfastcache \Drivers \Couchdb \Config ;
1617
1718// Include composer autoloader
1819require __DIR__ . '/../../vendor/autoload.php ' ;
1920
20- $ InstanceCache = CacheManager::getInstance ('couchdb ' , [
21+ $ InstanceCache = CacheManager::getInstance ('couchdb ' , new Config ( [
2122 'host ' => '127.0.0.1 ' ,
2223 'port ' => 5984 ,
2324 'path ' => '/ ' ,
2425 'username ' => 'your-couchdb-username ' ,
2526 'password ' => 'your-couchdb-password ' ,
2627 'ssl ' => true ,
2728 'timeout ' => 10 ,
28- ]);
29+ ])) ;
2930
3031/**
3132 * Try to get $products from Caching First
Original file line number Diff line number Diff line change 1818
1919
2020use Phpfastcache \CacheManager ;
21+ use Phpfastcache \Config \Config ;
2122use Phpfastcache \Core \phpFastCache ;
2223
2324// Setup File Path on your config files
24- CacheManager::setDefaultConfig ([
25+ CacheManager::setDefaultConfig (new Config ( [
2526 "path " => sys_get_temp_dir (),
2627 "itemDetailedDate " => false
27- ]);
28+ ])) ;
2829
2930// In your class, function, you can call the Cache
3031$ InstanceCache = CacheManager::getInstance ('files ' );
Original file line number Diff line number Diff line change 1818
1919
2020use Phpfastcache \CacheManager ;
21+ use Phpfastcache \Config \Config ;
2122use Phpfastcache \Core \phpFastCache ;
2223
2324// Setup File Path on your config files
24- CacheManager::setDefaultConfig ([
25+ CacheManager::setDefaultConfig (new Config ( [
2526 "path " => sys_get_temp_dir (),
26- ]);
27+ ])) ;
2728
2829// In your class, function, you can call the Cache
2930$ InstanceCache = CacheManager::getInstance ('leveldb ' );
Original file line number Diff line number Diff line change 1313 */
1414
1515use Phpfastcache \CacheManager ;
16+ use Phpfastcache \Drivers \Memcache \Config ;
1617
1718// Include composer autoloader
1819require __DIR__ . '/../../src/autoload.php ' ;
1920
20- $ InstanceCache = CacheManager::getInstance ('memcache ' , ['servers ' => [
21- [
21+ $ InstanceCache = CacheManager::getInstance ('memcache ' ,new Config ([
2222 'host ' =>'127.0.0.1 ' ,
2323 'port ' => 11211 ,
24- // 'sasl_user' => false, // optional
25- // 'sasl_password' => false // optional
26- ],
27- ]]);
24+ // 'sasl_user' => false, // optional
25+ // 'sasl_password' => false // optional
26+ ]));
2827
2928/**
3029 * In case you need to enable compress_data option:
Original file line number Diff line number Diff line change 1313 */
1414
1515use Phpfastcache \CacheManager ;
16+ use Phpfastcache \Drivers \Memcached \Config ;
1617
1718// Include composer autoloader
1819require __DIR__ . '/../../vendor/autoload.php ' ;
1920
20- $ InstanceCache = CacheManager::getInstance ('memcached ' , ['servers ' => [
21- [
21+ $ InstanceCache = CacheManager::getInstance ('memcached ' , new Config ([
2222 'host ' =>'127.0.0.1 ' ,
2323 'port ' => 11211 ,
2424 // 'sasl_user' => false, // optional
2525 // 'sasl_password' => false // optional
26- ],
27- ]]);
26+ ]));
2827
2928/**
3029 * In case you need SASL authentication:
Original file line number Diff line number Diff line change 1313 */
1414
1515use Phpfastcache \CacheManager ;
16+ use Phpfastcache \Drivers \Predis \Config ;
1617
1718// Include composer autoloader
1819require __DIR__ . '/../../vendor/autoload.php ' ;
1920
20- $ InstanceCache = CacheManager::getInstance ('predis ' , [
21+ $ InstanceCache = CacheManager::getInstance ('predis ' , new Config ( [
2122 'host ' => '127.0.0.1 ' , //Default value
2223 'port ' => 6379 , //Default value
2324 'password ' => null , //Default value
2425 'database ' => null , //Default value
25- ]);
26+ ])) ;
2627
2728/**
2829 * Try to get $products from Caching First
Original file line number Diff line number Diff line change 1313 */
1414
1515use Phpfastcache \CacheManager ;
16+ use Phpfastcache \Drivers \Redis \Config ;
1617
1718// Include composer autoloader
1819require __DIR__ . '/../../vendor/autoload.php ' ;
1920
20- $ InstanceCache = CacheManager::getInstance ('redis ' , [
21+ $ InstanceCache = CacheManager::getInstance ('redis ' , new Config ( [
2122 'host ' => '127.0.0.1 ' , //Default value
2223 'port ' => 6379 , //Default value
2324 'password ' => null , //Default value
2425 'database ' => null , //Default value
25- ]);
26+ ])) ;
2627
2728/**
2829 * Try to get $products from Caching First
You can’t perform that action at this time.
0 commit comments