2

我尝试使用 Gaufrette 安装 VichUploaderBundle,但出现错误:

The specified path (gaufrette://users_avatars_fs) is invalid.

作曲家.json

"require": {
    ...
    "vich/uploader-bundle": "dev-master",
    "knplabs/gaufrette": "0.2.*@dev",
    "knplabs/knp-gaufrette-bundle": "dev-master",
    "amazonwebservices/aws-sdk-for-php": "dev-master"
},

应用内核.php

    $bundles = array(
        ..
        new Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(),
        new Vich\UploaderBundle\VichUploaderBundle(),
    );

配置.yml

knp_gaufrette:
    stream_wrapper: ~ #<<<<----- Without this i had error that i pasted below
    adapters:
        users_avatars_adapter:
            local:
                directory: %kernel.root_dir%/../web/images/avatars
                create: true

    filesystems:
        users_avatars_fs:
            adapter:    users_avatars_adapter

vich_uploader:
    db_driver: orm
    gaufrette: true
    storage: vich_uploader.storage.gaufrette
    mappings:
        users_avatars:
            uri_prefix: /images/avatars
            upload_destination: users_avatars_fs

错误

Warning: is_file(): Unable to find the wrapper &quot;gaufrette&quot; - did you forget to enable it when you configured PHP? in /home/adam/public_html/project/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/FileValidator.php line 98 

我将不胜感激。

4

0 回答 0