Skip to content

No clear documentation about using phpfastcache new driver #468

@Altegras

Description

@Altegras

Configuration:

PhpFastCache version: ...6.0.1...
PHP version: ...7.1...
Operating system: ...debian...

Issue description:

It appears that there is a ton of documentation but not a single page is trying to describe HOW TO setup CacheManager with a config.

I'm trying to setup an object of phpfastcache-ssdb, no matter how I try to setup:

$container["cache"] = function () {
        \phpFastCache\CacheManager::setDefaultConfig(R_PLATFORM["settings"]["cache_driver"]);
        return new \phpFastCache\Helper\Psr16Adapter('ssdb');
    };

I get always:

Details

Type: phpFastCache\Exceptions\phpFastCacheDriverCheckException
Message: Ssdb is not installed or is misconfigured, cannot continue.
File: /usr/share/nginx/html/vendor/phpfastcache/phpfastcache/src/phpFastCache/CacheManager.php
Line: 216

Previous exception

Type: phpFastCache\Exceptions\phpFastCacheDriverCheckException
Message: Ssdb is not installed or is misconfigured, cannot continue.
File: /usr/share/nginx/html/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Ssdb/Driver.php
Line: 46

Line 46 of /usr/share/nginx/html/vendor/phpfastcache/phpfastcache/src/phpFastCache/Drivers/Ssdb/Driver.php states:

if (!$this->driverCheck()) {
            throw new phpFastCacheDriverCheckException(sprintf(self::DRIVER_CHECK_FAILURE, $this->getDriverName()));
        } elseif (!$this->driverConnect()) {
            throw new phpFastCacheDriverException('Ssdb is not connected, cannot continue.');
        }

this kills the script

public function driverCheck()
    {
        static $driverCheck;
        if ($driverCheck === null) {
            return ($driverCheck = class_exists('phpssdb\Core\SSDB'));
        }

        return $driverCheck;
    }

Searching thru files:

$ grep "SSDB" -R .
./phpfastcache/phpfastcache/src/phpFastCache/Drivers/Ssdb/Driver.php:use phpssdb\Core\SimpleSSDB;
./phpfastcache/phpfastcache/src/phpFastCache/Drivers/Ssdb/Driver.php:use phpssdb\Core\SSDBException;
./phpfastcache/phpfastcache/src/phpFastCache/Drivers/Ssdb/Driver.php: * @Property SimpleSSDB $instance Instance of driver service
./phpfastcache/phpfastcache/src/phpFastCache/Drivers/Ssdb/Driver.php: return ($driverCheck = class_exists('phpssdb\Core\SSDB'));
./phpfastcache/phpfastcache/src/phpFastCache/Drivers/Ssdb/Driver.php: $this->instance = new SimpleSSDB($host, $port, $timeout);
./phpfastcache/phpfastcache/src/phpFastCache/Drivers/Ssdb/Driver.php: } catch (SSDBException $e) {

I'm out of ideas ... how to make it work ?
Config array is (json exported):

"name":                                     "ssdb",
"host":                                     "10.255.255.100",
"port":                                     8888,
"password":                                 "",
"timeout":                                  1000

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions