Skip to content

Predis // Configuration issue #612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lexo13 opened this issue Jun 7, 2018 · 4 comments
Closed

Predis // Configuration issue #612

lexo13 opened this issue Jun 7, 2018 · 4 comments

Comments

@lexo13
Copy link

lexo13 commented Jun 7, 2018

Configuration

  • PhpFastCache version:
    7.0.0

  • PhpFastCache API version:
    2.0.4

  • PHP version:
    PHP 7.0.30-0ubuntu0.16.04.1 (cli) ( NTS )

Describe the bug

#!/usr/bin/php

<?php
require __DIR__ . '/vendor/autoload.php';

use Phpfastcache\CacheManager;
$InstanceCache = CacheManager::getInstance('predis', [
    'host' => '51.254.154.211', //Default value
    'port' => 6379, //Default value
    'password' => null, //Default value
    'database' => null, //Default value
]);
PHP Fatal error:  Uncaught Phpfastcache\Exceptions\PhpfastcacheInvalidConfigurationException: Invalid option(s) for the config Phpfastcache\Config\ConfigurationOption: host, port, password, database in /home/franck/public_html/message_queuing_hh/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Config/ConfigurationOption.php:115
Stack trace:
#0 /home/franck/public_html/message_queuing_hh/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/CacheManager.php(564): Phpfastcache\Config\ConfigurationOption->__construct(Array)
#1 /home/franck/public_html/message_queuing_hh/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/CacheManager.php(115): Phpfastcache\CacheManager::validateConfig(Array)
#2 /home/franck/public_html/message_queuing_hh/tt.php(10): Phpfastcache\CacheManager::getInstance('predis', Array)
#3 {main}
  thrown in /home/franck/public_html/message_queuing_hh/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Config/ConfigurationOption.php on line 115
@lexo13 lexo13 changed the title dqsd Error Predis Jun 7, 2018
@Geolim4 Geolim4 changed the title Error Predis Predis // Configuration issue Jun 7, 2018
@Geolim4 Geolim4 self-assigned this Jun 7, 2018
@Geolim4
Copy link
Member

Geolim4 commented Jun 7, 2018

Hello,

You used primitive arrays which is now deprecated as of v7.
Please read this:
https://github.com/PHPSocialNetwork/phpfastcache/blob/master/docs/migration/MigratingFromV6ToV7.md#configuration-option-type

Cheers,
Georges

@Geolim4 Geolim4 closed this as completed Jun 7, 2018
@lexo13
Copy link
Author

lexo13 commented Jun 7, 2018

Hi,

OK, it's not a bug but your example is out of date
https://github.com/PHPSocialNetwork/phpfastcache/blob/master/docs/examples/predis.php

@Geolim4
Copy link
Member

Geolim4 commented Jun 7, 2018

Indeed, I'll update them ASAP, thanks.

Geolim4 added a commit to Geolim4/phpfastcache that referenced this issue Jun 7, 2018
@Geolim4 Geolim4 mentioned this issue Jun 7, 2018
5 tasks
@Geolim4
Copy link
Member

Geolim4 commented Jun 7, 2018

It's now fixed, thanks @lexo13 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants