When trying to use LiipImagineBundle + VichUploaderBundle and Amazon S3, I'm encountering a weird issue. When I upload a file via my Symfony form (using the VichFileType form field), the file is successfully created on Amazon S3 (via Gaufrette). When I display the uploaded file in my twig view, it displays perfectly.
However, when I'm trying to generate a thumbnail of the file (which was uploaded on S3), I get the following error :
The service "liip_imagine.cache.resolver.amazon_s3" has a dependency
on a non-existent service "1".
I've followed the documentation : https://symfony.com/doc/2.0/bundles/LiipImagineBundle/cache-resolver/aws_s3.html
Here's my app/config/config.yml file:
# VichUploaderBundle Configuration
vich_uploader:
db_driver: orm
twig: true
storage: gaufrette
mappings:
campaign_image:
uri_prefix: "%aws_base_url%/%aws_bucket_name%/uploads/campaigns"
upload_destination: campaign_image_fs
namer: vich_uploader.namer_uniqid
delete_on_remove: true
delete_on_update: true
inject_on_load: true
user_identity:
uri_prefix: "%aws_base_url%/%aws_bucket_name%/uploads/users"
upload_destination: user_identity_fs
namer: vich_uploader.namer_uniqid
delete_on_remove: true
delete_on_update: true
inject_on_load: true
# LiipImagineBundle Configuration
liip_imagine:
driver: imagick
cache: amazon_s3
resolvers:
amazon_s3:
aws_s3:
client_config:
credentials:
key: "%aws_bucket_key%"
secret: "%aws_bucket_secret%"
region: "%aws_bucket_region%"
bucket: "%aws_bucket_name%"
version: "2006-03-01"
bucket: "%aws_bucket_name%"
cache: true
get_options:
Scheme: https
put_options:
CacheControl: "max-age=86400"
filter_sets:
cache: ~
800x600:
quality : 93
filters:
auto_rotate: ~
strip: ~
scale:
dim: [ 500, 800 ]
# KnpGaufretteBundle Configuration
knp_gaufrette:
stream_wrapper: ~
adapters:
user_identity_adapter:
aws_s3:
service_id: 'app.manager.amazon_s3'
bucket_name: '%aws_bucket_name%'
detect_content_type: true
options:
create: true
directory: uploads/users
campaign_image_adapter:
aws_s3:
service_id: 'app.manager.amazon_s3'
bucket_name: '%aws_bucket_name%'
detect_content_type: true
options:
create: true
directory: uploads/campaigns
filesystems:
user_identity_fs:
adapter: user_identity_adapter
campaign_image_fs:
adapter: campaign_image_adapter
And here is my app/config/services.yml file:
app.manager.amazon_s3:
class: Aws\S3\S3Client
factory_class: Aws\S3\S3Client
factory_method: 'factory'
arguments:
-
version: "2006-03-01"
region: "%aws_bucket_region%"
credentials: { "key": "%aws_bucket_key%", "secret": "%aws_bucket_secret%" }
app.imagine.cache.resolver.amazon_s3:
class: Liip\ImagineBundle\Imagine\Cache\Resolver\AwsS3Resolver
arguments:
- "#app.manager.amazon_s3"
- "%aws_bucket_name%"
- "public-read" # Aws\S3\Enum\CannedAcl::PUBLIC_READ (default)
- { Scheme: https }
- { CacheControl: "max-age=86400" }
calls:
- [ setGetOption, [ Scheme, https ] ]
- [ setPutOption, [ CacheControl, "max-age=86400" ] ]
tags:
- { name: "liip_imagine.cache.resolver", resolver: "amazon_s3"}
Any reasons for why I can't get it working?
I am new to Symfony and I am jumping into the deep end with OroCommerce. I thought I had successfully setup SncRedis (solely based on the fact that the app quit throwing errors at me). However, now that the app is completely setup and installed, I can see that file-based cache is still being generated.
I have a config.yml in place as well as a config_prod.yml but it seems that config_prod.yml only extends the config.yml so I don't think there are any conflicts in config_prod.yml.
# config.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
framework:
#esi: ~
translator: { fallback: en }
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: "%kernel.debug%"
form: true
csrf_protection: true
validation: { enable_annotations: true }
templating:
engines: ['twig', 'php']
assets_version: %assets_version%
assets_version_format: %%s?version=%%s
default_locale: "%locale%"
trusted_proxies: ~
session: ~
fragments:
enabled: true
path: /_fragment # used for controller action in template
serializer:
enabled: true
annotations:
cache: oro.cache.annotations
# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
exception_controller: "FOS\RestBundle\Controller\ExceptionController::showAction"
globals:
bap:
layout: ::base.html.twig # default layout across all Oro bundles
# Assetic Configuration
assetic:
debug: false
use_controller: false
filters:
cssrewrite: ~
lessphp:
file: %kernel.root_dir%/../vendor/leafo/lessphp/lessc.inc.php
apply_to: "\.less$"
paths: ["%kernel.root_dir%/../web/bundles"]
cssmin:
file: %kernel.root_dir%/Resources/php/cssmin-v3.0.1.php
# Swiftmailer Configuration
swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
port: "%mailer_port%"
encryption: "%mailer_encryption%"
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }
fos_rest:
body_listener:
decoders:
json: fos_rest.decoder.json
view:
failed_validation: HTTP_BAD_REQUEST
default_engine: php
formats:
json: true
xml: false
format_listener:
rules:
- { path: '^/api/rest', priorities: [ json ], fallback_format: json, prefer_extension: false }
- { path: '^/api/soap', stop: true }
- { path: '^/', stop: true }
routing_loader:
default_format: json
fos_js_routing:
routes_to_expose: [oro_*]
oro_frontend:
routes_to_expose: [oro_*]
stof_doctrine_extensions:
default_locale: en
translation_fallback: true
orm:
default:
translatable: true
tree: true
services:
twig.extension.intl:
class: Twig_Extensions_Extension_Intl
tags:
- { name: twig.extension }
oro.cache.abstract:
abstract: true
class: Snc\RedisBundle\Doctrine\Cache\RedisCache
calls:
- [setRedis, ["#snc_redis.default"]]
oro.cache.annotations:
public: false
parent: oro.cache.abstract
calls:
- [ setNamespace, [ "oro_annotations_cache" ] ]
escape_wsse_authentication:
authentication_provider_class: Oro\Bundle\UserBundle\Security\WsseAuthProvider
genemu_form:
select2: ~
autocomplete: ~
a2lix_translation_form:
locales: [en, fr]
templating: "OroUIBundle:Form:translatable.html.twig"
lexik_maintenance:
authorized:
path: "maintenance|.*\.js" # "maintenance" is only for demo purposes, remove in production!
# ips: ["127.0.0.1"] # Optional. Authorized ip addresses
driver:
class: Lexik\Bundle\MaintenanceBundle\Drivers\FileDriver
options:
file_path: %kernel.root_dir%/cache/maintenance_lock
#
# ORO Bundles config
#
oro_distribution:
entry_point: ~
oro_require_js:
build_path: "js/oro.min.js"
building_timeout: 3600
build:
preserveLicenseComments: true
oro_help:
defaults:
server: http://help.orocrm.com/
prefix: Third_Party
vendors:
Oro:
prefix: ~
alias: Platform
routes:
oro_default:
uri: Platform/OroDashboardBundle
oro_theme:
active_theme: oro
oro_message_queue:
transport:
default: '%message_queue_transport%'
'%message_queue_transport%': '%message_queue_transport_config%'
client: ~
snc_redis:
clients:
default:
type: predis
alias: default
dsn: redis://redis-session
logging: %kernel.debug%
session:
type: predis
alias: session
dsn: redis://redis-session/4
logging: %kernel.debug%
cache:
type: predis
alias: cache
dsn: redis://redis-session/1
logging: true
profiler_storage:
type: predis
alias: profiler_storage
dsn: redis://redis-session/2
logging: false
session:
client: session
prefix: session
doctrine:
metadata_cache:
client: cache
entity_manager: default
document_manager: default
result_cache:
client: cache
entity_manager: [default, read]
document_manager: [default, slave1, slave2]
namespace: "dcrc:"
query_cache:
client: cache
entity_manager: default
swiftmailer:
client: default
key: swiftmailer
doctrine:
orm:
query_cache_driver: redis
result_cache_driver: redis
jms_serializer:
metadata:
cache: Metadata\Cache\DoctrineCacheAdapter
You can install OroRedisConfigBundle that have snc/redis-bundle in dependency Instead. After that to work with redis you need to add 4 lines in parameters.yml of your application like:
session_handler: 'snc_redis.session.handler'
redis_dsn_session: 'redis://127.0.0.1:6379/0'
redis_dsn_cache: 'redis://127.0.0.1:6380/0'
redis_dsn_doctrine: 'redis://127.0.0.1:6380/1'
Don't forget to clear application cache.
And about cache folder (app/cache/prod for example). For Symfony applications it always be even if you enable redis.
There are Sonata Admin with enabled SonataProductBundle.
Product entity configured accordingly to documentation.
But, upon attempting to create new "Product" in admin panel,
"No object types available" button appears instead of edit form of.
Here are the configurations:
config.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: services.yml }
- { resource: sonata/sonata_product.yml }
- { resource: '#ApplicationSonataProductBundle/Resources/config/product.yml' }
parameters:
locale: en
framework:
esi: ~
translator: { fallbacks: ["%locale%"] }
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
serializer: { enable_annotations: true }
templating:
engines: ['twig']
#assets_version: SomeVersionScheme
default_locale: "%locale%"
trusted_hosts: ~
trusted_proxies: ~
session:
# handler_id set to null will use default session handler from php.ini
handler_id: ~
fragments: ~
http_method_override: true
Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
form:
resources:
- 'SonataFormatterBundle:Form:formatter.html.twig'
Doctrine Configuration
doctrine:
dbal:
driver: pdo_mysql
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
types:
json: Sonata\Doctrine\Types\JsonType
currency: Sonata\Component\Currency\CurrencyDoctrineType
orm:
auto_generate_proxy_classes: "%kernel.debug%"
entity_managers:
default:
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
mappings:
FOSUserBundle: ~
ApplicationSonataUserBundle: ~
SonataUserBundle: ~
SonataMediaBundle: ~
ApplicationSonataMediaBundle: ~
SonataNotificationBundle: ~
ApplicationSonataNotificationBundle: ~
SonataClassificationBundle: ~
ApplicationSonataClassificationBundle: ~
SonataClassificationBundle: ~
ApplicationSonataCustomerBundle: ~
SonataCustomerBundle: ~
ApplicationSonataProductBundle: ~
SonataProductBundle: ~
ApplicationSonataPageBundle: ~
SonataPageBundle: ~
Swiftmailer Configuration
swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }
sonata_block:
default_contexts: [cms]
blocks:
# enable the SonataAdminBundle block
sonata.admin.block.admin_list:
contexts: [admin]
# ...
sonata.user.block.menu: # used to display the menu in profile pages
sonata.user.block.account: # used to display menu option (login option)
sonata.block.service.text:
sonata.order.block.recent_orders:
context_manager: sonata.page.block.context_manager
sonata_admin:
title: IASP
title_logo: /bundles/sonataadmin/logo_title.png
options:
html5_validate: true # enable or disable html5 form validation
confirm_exit: true # enable or disable a confirmation before navigating away
use_select2: true # enable or disable usage of the Select2 jQuery library
use_icheck: true # enable or disable usage of the iCheck library
use_bootlint: false # enable or disable usage of Bootlint
use_stickyforms: true # enable or disable the floating buttons
form_type: standard # can also be 'horizontal'
templates:
dashboard: SonataAdminBundle:Core:dashboard.html.twig
edit: SonataAdminBundle:CRUD:edit.html.twig
tab_menu_template: SonataAdminBundle:Core:tab_menu_template.html.twig
fos_user:
db_driver: orm # can be orm or mongodb (support is also available within FOSUser for couchdb, propel but none is given for SonataUserBundle)
firewall_name: main
user_class: Application\Sonata\UserBundle\Entity\User
group:
group_class: Application\Sonata\UserBundle\Entity\Group
profile:
# Authentication Form
form:
type: fos_user_profile
handler: fos_user.profile.form.handler.default
name: fos_user_profile_form
validation_groups: [Authentication] # Please note : this is not the default value
sonata_user:
security_acl: false
manager_type: orm # Can be orm for mongodb
table:
user_group: "my_custom_user_group_association_table_name"
impersonating:
route: page_slug
parameters: { path: / }
class: # Entity Classes
user: Application\Sonata\UserBundle\Entity\User
group: Application\Sonata\UserBundle\Entity\Group
admin: # Admin Classes
user:
class: Sonata\UserBundle\Admin\Entity\UserAdmin
controller: SonataAdminBundle:CRUD
translation: SonataUserBundle
group:
class: Sonata\UserBundle\Admin\Entity\GroupAdmin
controller: SonataAdminBundle:CRUD
translation: SonataUserBundle
profile:
form:
type: sonata_user_profile
handler: sonata.user.profile.form.handler.default
name: sonata_user_profile_form
validation_groups: [Profile]
# Profile show page is a dashboard as in SonataAdminBundle
dashboard:
blocks:
- { position: left, type: sonata.block.service.text, settings: { content: "<h2>Welcome!</h2> This is a sample user profile dashboard, feel free to override it in the configuration! Want to make this text dynamic? For instance display the user's name? Create a dedicated block and edit the configuration!"} }
- { position: left, type: sonata.order.block.recent_orders, settings: { title: Recent Orders, number: 5, mode: public }}
#- { position: right, type: sonata.timeline.block.timeline, settings: { max_per_page: 15 }}
#- { position: right, type: sonata.news.block.recent_posts, settings: { title: Recent Posts, number: 5, mode: public }}
#- { position: right, type: sonata.news.block.recent_comments, settings: { title: Recent Comments, number: 5, mode: public }}
# Customize user portal menu by setting links
menu:
- { route: 'sonata_user_profile_show', label: 'sonata_profile_title', domain: 'SonataUserBundle'}
- { route: 'sonata_user_profile_edit', label: 'link_edit_profile', domain: 'SonataUserBundle'}
- { route: 'sonata_customer_addresses', label: 'link_list_addresses', domain: 'SonataCustomerBundle'}
- { route: 'sonata_user_profile_edit_authentication', label: 'link_edit_authentication', domain: 'SonataUserBundle'}
- { route: 'sonata_order_index', label: 'order_list', domain: 'SonataOrderBundle'}
sonata_delivery:
services:
free_address_required:
name: Free
priority: 1
code: free
selector: sonata.delivery.selector.default
sonata_media:
class:
media: Application\Sonata\MediaBundle\Entity\Media
gallery: Application\Sonata\MediaBundle\Entity\Gallery
gallery_has_media: Application\Sonata\MediaBundle\Entity\GalleryHasMedia
category: Application\Sonata\ClassificationBundle\Entity\Categor
default_context: default
db_driver: doctrine_orm # or doctrine_mongodb, doctrine_phpcr
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
providers:
image:
thumbnail: sonata.media.thumbnail.consumer.format
vimeo:
thumbnail: sonata.media.thumbnail.consumer.format
youtube:
thumbnail: sonata.media.thumbnail.consumer.format
dailymotion:
thumbnail: sonata.media.thumbnail.consumer.format
file:
allowed_extensions: ['mp4', 'flv']
allowed_mime_types: ['video/mp4', 'video/x-flv']
thumbnail: sonata.media.thumbnail.consumer.format
image:
resizer: sonata.media.resizer.square
sonata_payment:
services:
pass:
name: Pass
code: pass
browser: sonata.payment.browser.curl
transformers:
basket: sonata.payment.transformer.basket
order: sonata.payment.transformer.order
options:
shop_secret_key: assdsds
url_callback: sonata_payment_callback
url_return_ko: sonata_payment_error
url_return_ok: sonata_payment_confirmation
transformers:
order: sonata.payment.transformer.order
basket: sonata.payment.transformer.basket
sonata_price:
currency: EUR
sonata_customer:
class:
customer: Application\Sonata\CustomerBundle\Entity\Customer
address: Application\Sonata\CustomerBundle\Entity\Address
order: Application\Sonata\OrderBundle\Entity\Order
user: Application\Sonata\UserBundle\Entity\User
# You can also implement custom components classes
customer_selector: Sonata\Component\Customer\CustomerSelector
sonata_notification:
backend: sonata.notification.backend.runtime
admin:
enabled: false
sonata_classification:
class:
tag: Application\Sonata\ClassificationBundle\Entity\Tag
category: Application\Sonata\ClassificationBundle\Entity\Category
collection: Application\Sonata\ClassificationBundle\Entity\Collection
media: Application\Sonata\MediaBundle\Entity\Media
context: Application\Sonata\ClassificationBundle\Entity\Context
admin:
tag:
class: Sonata\ClassificationBundle\Admin\TagAdmin
controller: SonataAdminBundle:CRUD
translation: SonataClassificationBundle
category:
class: Sonata\ClassificationBundle\Admin\CategoryAdmin
controller: SonataClassificationBundle:CategoryAdmin
translation: SonataClassificationBundle
collection:
class: Sonata\ClassificationBundle\Admin\CollectionAdmin
controller: SonataAdminBundle:CRUD
translation: SonataClassificationBundle
context:
class: Sonata\ClassificationBundle\Admin\ContextAdmin
controller: SonataAdminBundle:CRUD
translation: SonataClassificationBundle
jms_serializer:
enable_short_alias: true
sonata_formatter:
default_formatter: text
formatters:
markdown:
service: sonata.formatter.text.markdown
extensions:
- sonata.formatter.twig.control_flow
- sonata.formatter.twig.gist
# - sonata.media.formatter.twig
text:
service: sonata.formatter.text.text
extensions:
- sonata.formatter.twig.control_flow
- sonata.formatter.twig.gist
# - sonata.media.formatter.twig
rawhtml:
service: sonata.formatter.text.raw
extensions:
- sonata.formatter.twig.control_flow
- sonata.formatter.twig.gist
# - sonata.media.formatter.twig
richhtml:
service: sonata.formatter.text.raw
extensions:
- sonata.formatter.twig.control_flow
- sonata.formatter.twig.gist
# - sonata.media.formatter.twig
twig:
service: sonata.formatter.text.twigengine
extensions: [] # Twig formatter cannot have extensions
sonata_product:
class:
product: Application\Sonata\ProductBundle\Entity\Product
package: Application\Sonata\ProductBundle\Entity\Package
product_category: Application\Sonata\ProductBundle\Entity\ProductCategory
product_collection: Application\Sonata\ProductBundle\Entity\ProductCollection
category: Application\Sonata\ClassificationBundle\Entity\Category
collection: Application\Sonata\ClassificationBundle\Entity\Collection
delivery: Application\Sonata\ProductBundle\Entity\Delivery
gallery: Application\Sonata\MediaBundle\Entity\Gallery
sonata_page:
slugify_service: sonata.core.slugify.cocur # old BC value is sonata.core.slugify.native
multisite: host_by_locale
default_template: default # template key from templates section, used as default for new pages
templates:
default: { path: 'SonataPageBundle::layout.html.twig', name: 'default' }
2columns: { path: 'SonataPageBundle::2columns_layout.html.twig', name: '2 columns layout' }
# Generates a snapshot when a page is saved (from the admin)
direct_publication: false # or %kernel.debug% if you want to publish in dev mode (but not in prod)
use_streamed_response: false # set the value to false in debug mode or if the reverse proxy does not handle streamed response
ignore_route_patterns:
- ^(.*)admin(.*) # ignore admin route, ie route containing 'admin'
- ^_(.*) # ignore symfony routes
ignore_routes:
- sonata_page_cache_esi
- sonata_page_cache_ssi
- sonata_page_js_sync_cache
- sonata_page_js_async_cache
- sonata_cache_esi
- sonata_cache_ssi
- sonata_cache_js_async
- sonata_cache_js_sync
- sonata_cache_apc
ignore_uri_patterns:
- ^/admin\/ # ignore admin route, ie route containing 'admin'
page_defaults:
homepage: {decorate: false, enabled: true} # disable decoration for homepage, key - is a page route
# manage the http errors
catch_exceptions:
not_found: [404] # render 404 page with "not_found" key (name generated: _page_internal_error_{key})
fatal: [500] # so you can use the same page for different http errors or specify specific page for each error
cache_invalidation:
service: sonata.page.cache.invalidation.simple
recorder: sonata.page.cache.recorder
classes:
"Application\Sonata\PageBundle\Entity\Block": getId
cmf_routing:
chain:
routers_by_id:
# enable the DynamicRouter with high priority to allow overwriting configured routes with content
#cmf_routing.dynamic_router: 200
# enable the symfony default router with a lower priority
sonata.page.router: 150
router.default: 100
composer.json
{
"name": "dmlabs-5/iasp_new",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
" \\": "src",
"AppBundle\\": "src/AppBundle",
"Application\\": "src/Application",
"ApplicationSonataMediaBundle\\": "src/Application/Sonata/MediaBundle",
"ApplicationSonataNotificationBundle\\": "src/Application/Sonata/NotificationBundle",
"ApplicationSonataCustomerBundle\\":"src/Application/Sonata/CustomerBundle",
"ApplicationSonataDeliveryBundle\\":"src/Application/Sonata/DeliveryBundle",
"ApplicationSonataClassificationBundle\\":"src/Application/Sonata/ClassificationBundle"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"require": {
"php": ">=5.3.9",
"symfony/symfony": "2.8.*",
"doctrine/orm": "^2.4.8",
"doctrine/doctrine-bundle": "~1.4",
"ocramius/proxy-manager": "^1.0",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"sonata-project/admin-bundle": "3.x-dev",
"sonata-project/doctrine-orm-admin-bundle": "3.x-dev",
"sonata-project/easy-extends-bundle": "^2.3",
"sonata-project/user-bundle": "3.x-dev",
"doctrine/doctrine-migrations-bundle": "^1.0",
"sonata-project/classification-bundle": "^3.0",
"sonata-project/cache-bundle": "^2.3",
"sonata-project/seo-bundle": "^2.1",
"sonata-project/notification-bundle": "^3.1",
"sonata-project/page-bundle": "^3.4",
"sonata-project/media-bundle": "^3.5",
"sonata-project/ecommerce": "3.x-dev",
"sonata-project/intl-bundle": "2.x-dev",
"sonata-project/formatter-bundle": "^3.1",
"jms/serializer-bundle": "^1.0",
"twig/twig": "^1.34",
"sonata-project/translation-bundle": "2.0.2"
},
"require-dev": {
"sensio/generator-bundle": "~3.0",
"symfony/phpunit-bridge": "~2.7"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
]
},
"config": {
"bin-dir": "bin"
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": null
}
}
Does anyone know, why this button appears? Is it configured in wrong way?
You get the same error cause you are maybe doing the same wrong? Look at your Simple Entity and notice the inherited Product class ... you define your Product class as abstract ... but your Product class is extending a BaseProduct class which is not shown in your post ...
This inheritance chain look strange to me. Can you check, your BaseProduct is not also abstract?
I've looked at everywhare but could not find a reference to this:
After configuring the HWIOAuthBundle and get a few problems solved I got the following error:
( ! ) Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException' with message 'The service "hwi_oauth.resource_owner.google" has a dependency on a non-existent service "session".' in E:\Servidor\Wamp\wamp\www\DEVELOPMENT\magnetics\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass.php on line 64
I'm using Symfony 2.6 and here are my configuration file:
imports:
- { resource: parameters.yml }
- { resource: security.yml }
framework:
#esi: ~
translator: { fallback: %locale% }
secret: %secret%
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: %kernel.debug%
form: ~
csrf_protection: false
validation: { enable_annotations: true }
templating:
engines: ['twig']
#assets_version: SomeVersionScheme
default_locale: "%locale%"
trusted_proxies: ~
session: false
fragments: ~
hwi_oauth:
# name of the firewall in which this bundle is active, this setting MUST be set
firewall_name: secured_area
resource_owners:
google:
type: google
client_id: "977681365085-3pb"
client_secret: "0IvhJ-DL7"
scope: "https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile"
#options:
#access_type: offline
# Twig Configuration
twig:
debug: %kernel.debug%
strict_variables: %kernel.debug%
exception_controller: 'FOS\RestBundle\Controller\ExceptionController::showAction'
# Assetic Configuration
assetic:
debug: %kernel.debug%
use_controller: false
bundles: [ MagneticsAdminBundle ]
#java: /usr/bin/java
filters:
cssrewrite: ~
#closure:
# jar: %kernel.root_dir%/Resources/java/compiler.jar
#yui_css:
# jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar
# Doctrine Configuration
doctrine:
dbal:
driver: %database_driver%
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, add the path in parameters.yml
# e.g. database_path: %kernel.root_dir%/data/data.db3
# path: %database_path%
orm:
auto_generate_proxy_classes: %kernel.debug%
auto_mapping: true
# Swiftmailer Configuration
swiftmailer:
transport: %mailer_transport%
host: %mailer_host%
username: %mailer_user%
password: %mailer_password%
spool: { type: memory }
sensio_framework_extra:
view: { annotations: false }
fos_rest:
disable_csrf_role: ROLE_API
param_fetcher_listener: true
view:
mime_types:
json: ['application/json', 'application/json;version=1.0', 'application/json;version=1.1']
view_response_listener: 'force'
formats:
xml: true
json: true
templating_formats:
html: true
format_listener:
rules:
- { path: ^/, priorities: [ html, json, xml ], fallback_format: ~, prefer_extension: true }
media_type:
version_regex: '/(v|version)=(?P<version>[0-9\.]+)/'
exception:
codes:
'Symfony\Component\Routing\Exception\ResourceNotFoundException': 404
'Doctrine\ORM\OptimisticLockException': HTTP_CONFLICT
messages:
'Symfony\Component\Routing\Exception\ResourceNotFoundException': true
allowed_methods_listener: true
access_denied_listener:
json: true
body_listener: true
fos_http_cache:
cache_control:
rules:
# the controls section values are used in a call to Response::setCache();
-
match:
path: ^/notes
methods: [GET, HEAD]
headers:
cache_control: { public: true, max_age: 15, s_maxage: 30 }
last_modified: "-1 hour"
vary: [Accept-Encoding, Accept-Language]
I've found similar problems but none of the solutions worked for me, anyone has an idea?
You have sessions disabled in your config
session: false
I don't know this for sure, but I'm going to guess that the session service isn't created when sessions are disabled at the framework level.
You can check by debugging the container
$ php app/console container:debug
Or more targeted
$ php app/console container:debug session
I'm working on Sonata Admin bundles. I've configure the Admin Dashboard and the following components are showing in the "Symfony CMF" group,
Here's the snapshot,
I've gone through the Symfony CMF sandbox site,
http://cmf.liip.ch/en/admin/dashboard
In this dashboard there are some other bundles like ,
Simple Block
Container Block etc are appearing.
Here's the snapshot,
I want to add the Content items as shown in the above pic in my "Symfony CMF" group.
How to do it ?
Here's my config.yml,
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: #IFISBMainBundle/Resources/config/admin.yml }
- { resource: doctrine_extensions.yml }
framework:
#esi: ~
translator: { fallback: en }
secret: %secret%
router: { resource: "%kernel.root_dir%/config/routing.yml" }
form: true
templating: { engines: ['twig'] } #assets_version: SomeVersionScheme
default_locale: %locale%
session: ~
# Twig Configuration
twig:
debug: %kernel.debug%
strict_variables: %kernel.debug%
# Assetic Configuration
assetic:
debug: %kernel.debug%
use_controller: false
#bundles: [CmfSimpleCmsBundle, CmfCreateBundle]
#java: /usr/bin/java
filters:
cssrewrite: ~
#lessphp:
#file: %kernel.root_dir%/../vendor/leafo/lessphp/lessc.inc.php
#apply_to: "\.less$"
#closure:
# jar: %kernel.root_dir%/Resources/java/compiler.jar
#yui_css:
# jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar
# for jackalope-doctrine-dbal
doctrine:
dbal:
driver: %database_driver%
host: %database_host%
port: %database_port%
dbname: %database_name%
user: %database_user%
password: %database_password%
path: %database_path%
charset: UTF8
types:
json: Sonata\Doctrine\Types\JsonType
orm:
entity_managers:
default:
auto_mapping: true
mappings:
ApplicationSonataUserBundle: ~
SonataUserBundle: ~
loggable:
type: annotation
alias: Gedmo
prefix: Gedmo\Loggable\Entity
dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Entity"
# cmf configuration
doctrine_phpcr:
# configure the PHPCR session
session:
backend:
type: %phpcr_backend%
workspace: %phpcr_workspace%
username: %phpcr_user%
password: %phpcr_pass%
# enable the ODM layer
odm:
auto_mapping: true
auto_generate_proxy_classes: %kernel.debug%
locales:
en:
- de
de:
- en
liip_doctrine_cache:
namespaces:
meta:
type: file_system
nodes:
type: file_system
cmf_core:
persistence:
phpcr:
enabled: true
basepath: /cms
publish_workflow:
enabled: false
multilang:
locales: %locales%
cmf_create:
editor_base_path: /bundles/cmfcreate/vendor/ckeditor/
cmf_simple_cms:
routing:
templates_by_class:
Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page: CmfSimpleCmsBundle:Page:index.html.twig
controllers_by_class:
Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute: cmf_routing.redirect_controller:redirectAction
cmf_routing:
chain:
routers_by_id:
cmf_routing.dynamic_router: 20
router.default: 100
dynamic:
enabled: true
persistence:
phpcr:
route_basepath: /cms/routes
knp_menu:
twig: true
lunetics_locale:
strict_mode: true
guessing_order:
- cookie
- router
- browser
allowed_locales: %locales%
sonata_block:
default_contexts: [cms]
blocks:
sonata.user.block.menu: # used to display the menu in profile pages
sonata.user.block.account: # used to display menu option (login option)
sonata.block.service.text:
sonata.block.service.rss:
sonata.admin.block.admin_list:
contexts: [admin]
sonata_admin_doctrine_phpcr.tree_block:
settings:
id: '/cms'
contexts: [admin]
sonata_admin:
title: Admin
title_logo: bundles/acmemain/images/if_logo_small.gif
templates:
# default global templates
ajax: SonataAdminBundle::ajax_layout.html.twig
dashboard:
blocks:
# display a dashboard block
- { position: right, type: sonata.admin.block.admin_list }
- { position: left, type: sonata_admin_doctrine_phpcr.tree_block }
sonata_doctrine_phpcr_admin:
document_tree:
Doctrine\ODM\PHPCR\Document\Generic:
valid_children:
- all
Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page:
valid_children:
- all
Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route:
valid_children:
- Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route
- Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute
Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute:
valid_children: []
Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode:
valid_children:
- Symfony\Cmf\Bundle\MenuBundle\Doctrine\Phpcr\MenuNode
swiftmailer:
transport: gmail
username: witribeman#gmail.com
password: headphones
logging: "%kernel.debug%"
fos_user:
db_driver: orm # can be orm or odm
firewall_name: main
user_class: Application\Sonata\UserBundle\Entity\User
group:
group_class: Application\Sonata\UserBundle\Entity\Group
from_email:
address: noreply#ifi-admin.com
sender_name: IFI Admin
sonata_user:
security_acl: true
manager_type: orm # can be orm or mongodb
class:
user: Application\Sonata\UserBundle\Entity\User
I'm also confused from where and how Symfony CMF group items gets rendered.
Kindly, let me know how to add other CMF bundle under my Symfony CMF group.
Thanks,
Faisal Nasir
Put your entity service in dashboard
dashboard:
blocks:
# display a dashboard block
- { position: left, type: sonata.admin.block.admin_list, settings: { groups: [Personnel,Settings] } }
- { position: right, type: sonata.admin.block.admin_list }
groups:
Personnel: #Menu name
items:
- example.abc.a #your services
Settings: #Menu name
items:
- example.abc.a #your services