Skip to content
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

SncRedisBundle fails if predis is not present #335

Closed
frostieDE opened this issue Apr 2, 2018 · 3 comments
Closed

SncRedisBundle fails if predis is not present #335

frostieDE opened this issue Apr 2, 2018 · 3 comments

Comments

@frostieDE
Copy link

frostieDE commented Apr 2, 2018

Currently, when installing SncRedisBundle, it seems to assume that Predis is installed:

PS D:\Dev\Pi\pi-wifi-web> composer require snc/redis-bundle
Using version ^2.0 for snc/redis-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing snc/redis-bundle (2.0.6): Downloading (100%)
Writing lock file
Generating autoload files
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
Symfony operations: 1 recipe (20805ee9e510b690176a43d9411aaa83)
  -  WARNING  snc/redis-bundle (>=2.0): From github.com/symfony/recipes-contrib:master
    The recipe for this package comes from the "contrib" repository, which is open to community contributions.
    Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/snc/redis-bundle/2.0

    Do you want to execute this recipe?
    [y] Yes
    [n] No
    [a] Yes for all packages, only for the current installation session
    [p] Yes permanently, never ask again for this project
    (defaults to n): y
  - Configuring snc/redis-bundle (>=2.0): From github.com/symfony/recipes-contrib:master
Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 255
!!
!!  Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "Factory" from namespace "Predis\Profile".
!!  Did you forget a "use" statement for another namespace? in D:\Dev\Pi\pi-wifi-web\vendor\snc\redis-bundle\DependencyInjection\SncRedisExtension.php:175
!!  Stack trace:
!!  #0 D:\Dev\Pi\pi-wifi-web\vendor\snc\redis-bundle\DependencyInjection\SncRedisExtension.php(105): Snc\RedisBundle\DependencyInjection\SncRedisExtension->loadPredisClient(Array, Object(Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationContainerBuilder))
!!  #1 D:\Dev\Pi\pi-wifi-web\vendor\snc\redis-bundle\DependencyInjection\SncRedisExtension.php(52): Snc\RedisBundle\DependencyInjection\SncRedisExtension->loadClient(Array, Object(Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationContainerBuilder))
!!  #2 D:\Dev\Pi\pi-wifi-web\vendor\symfony\dependency-injection\Compiler\MergeExtensionConfigurationPass.php(71): Snc\RedisBundle\DependencyInjection\SncRedisExtension->load(Array, Obj in D:\Dev\Pi\pi-wifi-web\vendor\snc\redis-bundle\DependencyInjection\SncRedisExtension.php on line 175
!!

Installation failed, reverting ./composer.json to its original content.

I guess this error comes from the default configuration which has predis as default connection type. After installing predis, the bundle can be installed.

@fabpot
Copy link
Member

fabpot commented Apr 3, 2018

I'm closing as this is an issue in the bundle itself. You should report it there. Thank you.

@fabpot fabpot closed this as completed Apr 3, 2018
@xabbuh
Copy link
Member

xabbuh commented Apr 3, 2018

@fabpot We indeed make the assumption that predis is available in the recipe: https://github.com/symfony/recipes-contrib/blob/master/snc/redis-bundle/2.0/config/packages/snc_redis.yaml#L4

@curry684
Copy link
Contributor

curry684 commented Apr 6, 2018

Apart from the bundle not handling it nicely it's also a broken recipe that needs fixing - it generates config now which depends on a component that may never get installed in the entire project, making it a crash waiting to happen. It should just suggest something in comments.

github-actions bot pushed a commit to nicolas-grekas/recipes-contrib that referenced this issue Sep 16, 2021
The recipe should not be opinionated about using phpredis or predis as the bundle supports both.

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

No branches or pull requests

4 participants