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

Added VichUploaderBundle recipe #22

Merged
merged 2 commits into from
May 26, 2017

Conversation

javiereguiluz
Copy link
Member

@javiereguiluz javiereguiluz commented May 14, 2017

About the bundle:

License MIT

symfony-bot
symfony-bot previously approved these changes May 14, 2017
@javiereguiluz
Copy link
Member Author

In the original bundle docs, they use %kernel.root_dir%/../ instead of %kernel.project_dir%/ but I've changed it to align with modern Symfony practices. Should Symfony Bot check if kernel.root_dir is used and suggest a change?

@Pierstoval
Copy link
Contributor

Actually, it would be better if the bot could detect %kernel.root_dir%/../ instead IMO

vich_uploader:
db_driver: orm

# mappings:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is an extra space here that should be removed (i.e: should be #mappings:) thus the user doesn't have to delete 2 space while removing the comments :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, people will just remove the # and the indentation will be off.

@yceruto
Copy link
Member

yceruto commented May 16, 2017

@fabpot I've tested this recipe and I don't see the Setting configuration and copying files step:

Package operations: 11 installs, 0 updates, 0 removals
  - Installing jms/metadata (1.6.0): Loading from cache
  - Installing symfony/asset (dev-master 67ee69a): Loading from cache
  - Installing symfony/inflector (dev-master aed5a08): Loading from cache
  - Installing paragonie/random_compat (v2.0.10): Loading from cache
  - Installing symfony/polyfill-php70 (dev-master 13ce343): Loading from cache
  - Installing symfony/property-access (dev-master 1bb34c3): Loading from cache
  - Installing symfony/polyfill-util (dev-master 746bce0): Loading from cache
  - Installing symfony/polyfill-php56 (dev-master 1dd42b9): Loading from cache
  - Installing symfony/security (dev-master 39263c7): Downloading (100%)         
  - Installing symfony/templating (dev-master 503b8be): Loading from cache
  - Installing vich/uploader-bundle (dev-master 83c3e27): Downloading (100%)         
    Detected auto-configuration settings for "vich/uploader-bundle"
    Enabling the package as a Symfony bundle

No file copied.

@javiereguiluz
Copy link
Member Author

@yceruto in case you did the same mistake as I did, have you enabled the installation of contrib recipes? composer config extra.symfony.allow-contrib true

@yceruto
Copy link
Member

yceruto commented May 16, 2017

@javiereguiluz yeap :) all of them https://symfony.sh/r/contrib/22

@yceruto
Copy link
Member

yceruto commented May 16, 2017

Hence, if cli has been already installed before, while composer req "vich/uploader-bundle:^1.5":

...
Executing script assets:install --symlink --relative %WEB_DIR% [KO]
 [KO]
Script assets:install --symlink --relative %WEB_DIR% returned with error code 1
!!  
!!  
!!                                                                                   
!!    [Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]  
!!    The child node "db_driver" at path "vich_uploader" must be configured.         
!!  
!!                                                                                   
!!  
!!  
!!  

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

@Pierstoval
Copy link
Contributor

@yceruto Making vich/uploader-bundle require symfony/console and might solve the issue

@yceruto
Copy link
Member

yceruto commented May 16, 2017

@Pierstoval I don't think so, the issue is that #22 (comment)

@fabpot
Copy link
Member

fabpot commented May 16, 2017

@yceruto That's because it installed the master version (which is 1.6) and this recipe is for 1.5 only.

@yceruto
Copy link
Member

yceruto commented May 16, 2017

@fabpot same issue for 1.5:

$ composer req "vich/uploader-bundle:1.5"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 15 installs, 0 updates, 0 removals
  - Installing ocramius/package-versions (1.1.2): Loading from cache
  - Installing jms/metadata (1.6.0): Loading from cache
  - Installing zendframework/zend-eventmanager (dev-develop 42d2abc): Loading from cache
  - Installing zendframework/zend-code (dev-develop e8e6491): Loading from cache
  - Installing ocramius/proxy-manager (2.1.x-dev e18ac87): Loading from cache
  - Installing symfony/asset (dev-master 67ee69a): Loading from cache
  - Installing symfony/inflector (dev-master aed5a08): Loading from cache
  - Installing paragonie/random_compat (v2.0.10): Loading from cache
  - Installing symfony/polyfill-php70 (dev-master 13ce343): Loading from cache
  - Installing symfony/property-access (dev-master 1bb34c3): Loading from cache
  - Installing symfony/polyfill-util (dev-master 746bce0): Loading from cache
  - Installing symfony/polyfill-php56 (dev-master 1dd42b9): Loading from cache
  - Installing symfony/security (dev-master 39263c7): Loading from cache
  - Installing symfony/templating (dev-master 503b8be): Loading from cache
  - Installing vich/uploader-bundle (1.5.0): Loading from cache
    Detected auto-configuration settings for "vich/uploader-bundle"
    Enabling the package as a Symfony bundle
Writing lock file
Generating autoload files
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
Executing script make cache-warmup [OK]
Executing script assets:install --symlink --relative %WEB_DIR% [KO]
 [KO]
Script assets:install --symlink --relative %WEB_DIR% returned with error code 1
!!  
!!  
!!                                                                                   
!!    [Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]  
!!    The child node "db_driver" at path "vich_uploader" must be configured.         
!!  
!!                                                                                   
!!  
!!  
!!  

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

@yceruto
Copy link
Member

yceruto commented May 16, 2017

Somebody else have the same issue or am I the only one?

@Koc
Copy link

Koc commented May 16, 2017

@yceruto let's wait until 1.6 version of bundle will released

@fabpot
Copy link
Member

fabpot commented May 16, 2017

@yceruto Try using the latest version 1.5.3, and it works:

composer req "vich/uploader-bundle:1.5.3"

@yceruto
Copy link
Member

yceruto commented May 16, 2017

I had to clean the composer cache to make it work, I don't know why :(

On the other hand, this bundle require doctrine/annotations:

Executing script assets:install --symlink --relative %WEB_DIR% [KO]
 [KO]
Script assets:install --symlink --relative %WEB_DIR% returned with error code 1
!!  
!!  
!!                                                                                 
!!  
!!  
!!    [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]   
!!  
!!  
!!    The service "vich_uploader.property_mapping_factory" has a dependency on a   
!!  
!!  
!!    non-existent service "annotation_reader".                                    
!!  
!!  
!!                                                                                 
!!  
!!  
!!  
!!  
!!  

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

@stof
Copy link
Member

stof commented May 17, 2017

@yceruto FrameworkBundle does not install the annotation layer by default anymore in 3.3. If the bundle needs it, it should add a dependency on doctrine/annotations

Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyone willing to make a PR on the bundle to add the missing annotations dependency?

vich_uploader:
db_driver: orm

# mappings:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, people will just remove the # and the indentation will be off.

@symfony-bot symfony-bot merged commit ad960de into symfony:master May 26, 2017
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

Successfully merging this pull request may close these issues.

None yet

7 participants