2017-08-08 4 views
0

sind versucht, auf einem symfony Sonate Medienpaket installieren 3.3.6Sonata Media-Bundle Installationsfehler

ich diesen doc bin Folowing: https://sonata-project.org/bundles/media/3-x/doc/reference/installation.html

Aber ich habe einen Fehler, wenn ich diesen Befehl bin mit php ist/Konsole Lehre: Schema: update --force

die Fehlermeldung: Zeile, an der DB erzeugt

[Doctrine\DBAL\DBALException] Unknown column type "json" requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database introspection then you might have forgot to register all database types for a Doctrine Type. Use AbstractPlatform#registerDoctrineType Mapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot some mapping information.

meine config.yml von dem documentati genommen wird auf. Ich habe alle diese Artikel überprüft und nirgends finde ich eine Antwort. Warum tritt dieser Fehler auf? Hilfe bitte, ich fange

Antwort

0

Sie haben enttäuscht werden json Art in Ihrer Lehre Konfiguration hinzuzufügen:

doctrine: 
    dbal: 
     types: 
      json:  Sonata\Doctrine\Types\JsonType 

In Ihrer Konfigurationsdatei, Sie Lehre Abschnitt zweimal haben. Die erste ist angewandt:

doctrine: 
    dbal: 
     driver: pdo_mysql 
     host: '%database_host%' 
     port: '%database_port%' 
     dbname: '%database_name%' 
     user: '%database_user%' 
     password: '%database_password%' 
     charset: UTF8 
     # if using pdo_sqlite as your database driver: 
     # 1. add the path in parameters.yml 
     #  e.g. database_path: '%kernel.project_dir%/var/data/data.sqlite' 
     # 2. Uncomment database_path in parameters.yml.dist 
     # 3. Uncomment next line: 
     #path: '%database_path%' 

    orm: 
     auto_generate_proxy_classes: '%kernel.debug%' 
     naming_strategy: doctrine.orm.naming_strategy.underscore 
     auto_mapping: true 

und du hast die JSON es nicht definieren geben.

+0

Ich habe diese Konstruktion – dmitry76

+0

Sie haben Doktrin zweimal. Es ist inakzeptabel. Sie müssen diese Konfiguration zusammenführen. der erste wird angewendet und Sie haben dort keinen JSON-Typ. – Vladislav

+0

OMG! Ich hatte Verdacht, aber ich bin neu in der Symphonie, vielen Dank! – dmitry76

0
imports: 
    - { resource: parameters.yml } 
    - { resource: security.yml } 
    - { resource: services.yml } 
    - { resource: "@AppBundle/Resources/config/admin.yml" } 
    - { resource: sonata_classification.yml } 
# Put parameters here that don't need to change on each machine where the app is deployed 
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration 
parameters: 
    locale: ru 

framework: 
    #esi: ~ 
    translator: { fallbacks: ['%locale%'] } 
    secret: '%secret%' 
    router: 
     resource: '%kernel.project_dir%/app/config/routing.yml' 
     strict_requirements: ~ 
    form: ~ 
    csrf_protection: ~ 
    validation: { enable_annotations: true } 
    #serializer: { enable_annotations: true } 
    templating: 
     engines: ['twig'] 
    default_locale: '%locale%' 
    trusted_hosts: ~ 
    session: 
     # https://symfony.com/doc/current/reference/configuration/framework.html#handler-id 
     handler_id: session.handler.native_file 
     save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%' 
    fragments: ~ 
    http_method_override: true 
    assets: ~ 
    php_errors: 
     log: true 

# Twig Configuration 
twig: 
    debug: '%kernel.debug%' 
    strict_variables: '%kernel.debug%' 

# Doctrine Configuration 
doctrine: 
    dbal: 
     driver: pdo_mysql 
     host: '%database_host%' 
     port: '%database_port%' 
     dbname: '%database_name%' 
     user: '%database_user%' 
     password: '%database_password%' 
     charset: UTF8 
     # if using pdo_sqlite as your database driver: 
     # 1. add the path in parameters.yml 
     #  e.g. database_path: '%kernel.project_dir%/var/data/data.sqlite' 
     # 2. Uncomment database_path in parameters.yml.dist 
     # 3. Uncomment next line: 
     #path: '%database_path%' 

    orm: 
     auto_generate_proxy_classes: '%kernel.debug%' 
     naming_strategy: doctrine.orm.naming_strategy.underscore 
     auto_mapping: true 

# Swiftmailer Configuration 
swiftmailer: 
    transport: '%mailer_transport%' 
    host: '%mailer_host%' 
    username: '%mailer_user%' 
    password: '%mailer_password%' 
    spool: { type: memory } 

#Cache 
doctrine_cache: 
    providers: 
     my_markdown_cache: 
      type: file_system 
      file_system: 
       directory: /tmp/doctrine_cache 

sonata_admin: 
    title: My Blog Admin 


sonata_block: 
    default_contexts: [cms] 
    blocks: 
     sonata.admin.block.admin_list: 
      contexts: [admin] 

doctrine: 
    orm: 
     entity_managers: 
      default: 
       mappings: 
        ApplicationSonataMediaBundle: ~ 
        SonataMediaBundle: ~ 


    dbal: 
     types: 
      json: Sonata\Doctrine\Types\JsonType 

sonata_media: 
    # if you don't use default namespace configuration 
    #class: 
    # media: MyVendor\MediaBundle\Entity\Media 
    # gallery: MyVendor\MediaBundle\Entity\Gallery 
    # gallery_has_media: MyVendor\MediaBundle\Entity\GalleryHasMedia 
    db_driver: doctrine_orm # or doctrine_mongodb, doctrine_phpcr it is mandatory to choose one here 
    default_context: default # you need to set a context 
    contexts: 
     default: # the default context is mandatory 
      providers: 
       - sonata.media.provider.dailymotion 
       - sonata.media.provider.youtube 
       - sonata.media.provider.image 
       - sonata.media.provider.file 
       - sonata.media.provider.vimeo 

      formats: 
       small: { width: 100 , quality: 70} 
       big: { width: 500 , quality: 70} 

    cdn: 
     server: 
      path: /uploads/media # http://media.sonata-project.org/ 

    filesystem: 
     local: 
      directory: "%kernel.root_dir%/../web/uploads/media" 
      create:  false 

sonata_media: 
    providers: 
     image: 
      resizer: sonata.media.resizer.square 

doctrine: 
    orm: 
     entity_managers: 
      default: 
       mappings: 
        ApplicationSonataMediaBundle: ~ 
        SonataMediaBundle: ~ 
Verwandte Themen