daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest Oct 3rd, 2017 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. php app/console sonata:easy-extends:generate --dest=src SonataMediaBundle
  2.    
  3. imports:
  4. - { resource: parameters.yml }
  5. - { resource: security.yml }
  6. - { resource: services.yml }
  7. - { resource: Bundle/FOS/fos_user.yml }
  8. - { resource: "@UserBundle/Resources/config/services.yml" }
  9. - { resource: Bundle/SONATA/sonata_block.yml }
  10. - { resource: Bundle/SONATA/sonata_media_bundle_config.yml }
  11. parameters:
  12.       locale: en
  13.  
  14. framework:
  15.     #esi: ~
  16.     translator: { fallbacks: ['%locale%'] }
  17.     secret: '%secret%'
  18.     router:
  19.         resource: '%kernel.project_dir%/app/config/routing.yml'
  20.         strict_requirements: ~
  21.     form: ~
  22.     csrf_protection:
  23.             enabled: true
  24.     validation: { enable_annotations: true }
  25.     #serializer: { enable_annotations: true }
  26.     templating:
  27.         engines: ['twig']
  28.     default_locale: '%locale%'
  29.     trusted_hosts: ~
  30.     session:
  31.  
  32.         handler_id: session.handler.native_file
  33.         save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'
  34.     fragments: ~
  35.     http_method_override: true
  36.     assets: ~
  37.     php_errors:
  38.         log: true
  39. doctrine:
  40.     dbal:
  41.         driver: "pdo_pgsql"
  42.         host: '%database_host%'
  43.         port: '%database_port%'
  44.         dbname: '%database_name%'
  45.         user: '%database_user%'
  46.         password: '%database_password%'
  47.         charset: UTF8
  48.         # if using pdo_sqlite as your database driver:
  49.         #   1. add the path in parameters.yml
  50.         #     e.g. database_path:     '%kernel.project_dir%/var/data/data.sqlite'
  51.         #   2. Uncomment database_path in parameters.yml.dist
  52.         #   3. Uncomment next line:
  53.         #path: '%database_path%'
  54.         types:
  55.             json: SonataDoctrineTypesJsonType
  56.  
  57. orm:
  58.     auto_generate_proxy_classes: %kernel.debug%
  59.     default_entity_manager: default
  60.     entity_managers:
  61.         default:
  62.             auto_mapping: true
  63.             mappings:
  64.                 SonataMediaBundle: ~
  65.    
  66. sonata_media:
  67.     db_driver: doctrine_orm # or doctrine_mongodb, doctrine_phpcr it is mandatory to choose one here
  68.     default_context: default # you need to set a context
  69.     # if you don't use default namespace configuration
  70.     class:
  71.         media: MediaBundleEntityMedia
  72.         gallery: MediaBundleEntityGallery
  73.         gallery_has_media: MediaBundleEntityGalleryHasMedia
  74.     contexts:
  75.         default:  # the default context is mandatory
  76.             providers:
  77.                 - sonata.media.provider.image
  78.                 - sonata.media.provider.file
  79.  
  80.         formats:
  81.             small: { width: 100, quality: 100}
  82.             medium: { width: 500 , quality: 100}
  83.             big:   { width: 970 , quality: 100}
  84.  
  85. providers:
  86.     image:
  87.         resizer: sonata.media.resizer.square
  88. cdn:
  89.     server:
  90.         path: /uploads/media # http://media.sonata-project.org/
  91.  
  92. filesystem:
  93.     local:
  94.         directory:  "%kernel.root_dir%/../web/uploads/media"
  95.         create:     false
  96. providers:
  97.     image:
  98.         filesystem: sonata.media.filesystem.local
  99.         resizer: sonata.media.resizer.square
  100.         cdn:        sonata.media.cdn.server
  101.         generator:  sonata.media.generator.default
  102.         thumbnail:  sonata.media.thumbnail.format
  103.         allowed_extensions: ['jpg', 'png', 'jpeg', 'gif', 'tiff']
  104.         allowed_mime_types: ['image/pjpeg', 'image/jpeg', 'image/png', 'image/x-png', 'image/gif', 'image/tiff']
  105.     file:
  106.         service:    sonata.media.provider.file
  107.         resizer:    false
  108.         filesystem: sonata.media.filesystem.local
  109.         cdn:        sonata.media.cdn.server
  110.         generator:  sonata.media.generator.default
  111.         thumbnail:  sonata.media.thumbnail.format
  112.         allowed_extensions: ['pdf', 'txt', 'rtf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pttx', 'odt', 'odg', 'odp', 'ods', 'odc', 'odf', 'odb', 'csv', 'xml']
  113.         allowed_mime_types: ['application/pdf', 'application/x-pdf', 'application/rtf', 'text/html', 'text/rtf', 'text/plain']
  114.     image:
  115.        thumbnail: sonata.media.thumbnail.format
  116. pixlr:
  117.     enabled:  true
  118.     referrer: Demo - Sonata Project
  119. resizer:
  120.     simple:
  121.         mode:  inset
  122. buzz:
  123.     connector:  sonata.media.buzz.connector.file_get_contents
  124.  
  125.  
  126. ***My Bundle/SONATA/sonata_block.yml is***
  127.  
  128. sonata_block:
  129. default_contexts: [cms]
  130. blocks:
  131.     # enable the SonataAdminBundle block
  132.     sonata.admin.block.admin_list:
  133.         contexts: [admin]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top