Theme management for Symfony.
Documentation is available in the docs folder.
Please use [email protected]
email to report security issues.
The bundle was originally created by Kamil Kokot. See the list of contributors.
Theming for Symfony, supports templates, assets and translations.
Home Page: https://sylius.com
License: MIT License
Theme management for Symfony.
Documentation is available in the docs folder.
Please use [email protected]
email to report security issues.
The bundle was originally created by Kamil Kokot. See the list of contributors.
During some testing i run into performance issues, regarding the version 1.x of this bundle (dont know about v2 yet).
What? | version |
---|---|
Sylius | 1.8 |
SyliusThemeBundle | 1.5.1 |
Test was done via siege and without any theme installed/configured (plain demo data) and in prod!
siege http://127.0.0.1:8081/en_US/ -b -c 20 -t5m --no-parser -v
Theme bundle active | Yes | No | |
---|---|---|---|
Transactions: | 3496 | 5220 | hits |
Availability: | 100 | 100 | % |
Elapsed time: | 299.2 | 299.61 | secs |
Data transferred: | 63.23 | 94.41 | MB |
Response time: | 1.71 | 1.15 | secs |
Transaction rate: | 11.68 | 17.42 | trans/sec |
Throughput: | 0.21 | 0.32 | MB/sec |
Concurrency: | 19.94 | 19.96 | |
Successful transactions: | 3496 | 5220 | |
Failed transactions: | 0 | 0 | |
Longest transaction: | 4.99 | 3.36 | |
Shortest transaction: | 0.28 | 0.17 |
X Debug Profiles
Theme bundle active | Yes | No |
---|---|---|
Function calls | 79 293 | 72 149 |
Possible Issue:
From my research from one of the main issues is Sylius\Bundle\ThemeBundle\Twig\ThemeFilesystemLoader
is used even if no theme is registered. This results in Sylius\Bundle\ThemeBundle\Twig\ThemeFilesystemLoader::getCacheKey
and the other methods to always throw an exception and then falls back to the default TwigLoader and bypass the cache.
In dev mode its even worse as the lookup is done again during Symfony\Bridge\Twig\DataCollector\TwigDataCollector::lateCollect
and again fails to hit the first level cache
I attached the corresponding xdebug profiles
cachegrind.out.zip
Hi,
are there any custom themes to be used in Sylius project?
psst Magento has a lot public themes :)
I have performance issues with migrating from liip/theme-bundle to SyliusThemeBundle.
vendor | version |
---|---|
PHP | 7.4.12 |
Symfony/Symfony | 4.4.15 |
Sylius/SyliusThemeBundle | 2.2.0 |
sonata-project/SonataAdminBundle | 3.76 |
Our project has more than 3 themes and we are using SonataAdminBundle. It has many twig template calls to rendering small blocks.
As a result, Sylius\Bundle\ThemeBundle\Twig\ThemeFilesystemLoader::locateTemplate
is called more than 200 times per request.
Inside this method HierarchicalTemplateLocator
rotating through all themes and all themed locators for each twig render call. It tooks very long time for such frequent calls.
In total, requests fall in timeout.
I have profiler screenshots to show my case (dev environment):
one more screen - for CRUD list action, 2 themes configured:
Based on the above, for now I can't using this bundle for my project. I don't understand why this bundle is recommended to replacing for liip/theme-bundle.
With symfony 4.3 I have some notice during my production deployment :
$ composer dump-autoload --optimize
Warning: Ambiguous class resolution, "Symfony\Contracts\Cache\CallbackInterface" was found in
both "vendor/symfony/cache-contracts/CallbackInterface.php"
and "vendor/symfony/contracts/Cache/CallbackInterface.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\Cache\ItemInterface" was found in
both "vendor/symfony/cache-contracts/ItemInterface.php"
and "vendor/symfony/contracts/Cache/ItemInterface.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\Cache\CacheInterface" was found in
both "vendor/symfony/cache-contracts/CacheInterface.php"
and "vendor/symfony/contracts/Cache/CacheInterface.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\Cache\CacheTrait" was found in
both "vendor/symfony/cache-contracts/CacheTrait.php"
and "vendor/symfony/contracts/Cache/CacheTrait.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\Cache\TagAwareCacheInterface" was found in
both "vendor/symfony/cache-contracts/TagAwareCacheInterface.php"
and "vendor/symfony/contracts/Cache/TagAwareCacheInterface.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\Translation\TranslatorInterface" was found in
both "vendor/symfony/translation-contracts/TranslatorInterface.php"
and "vendor/symfony/contracts/Translation/TranslatorInterface.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\Translation\LocaleAwareInterface" was found in
both "vendor/symfony/translation-contracts/LocaleAwareInterface.php"
and "vendor/symfony/contracts/Translation/LocaleAwareInterface.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\Translation\TranslatorTrait" was found in
both "vendor/symfony/translation-contracts/TranslatorTrait.php"
and "vendor/symfony/contracts/Translation/TranslatorTrait.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\EventDispatcher\EventDispatcherInterface" was found in
both "vendor/symfony/event-dispatcher-contracts/EventDispatcherInterface.php"
and "vendor/symfony/contracts/EventDispatcher/EventDispatcherInterface.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\EventDispatcher\Event" was found in
both "vendor/symfony/event-dispatcher-contracts/Event.php"
and "vendor/symfony/contracts/EventDispatcher/Event.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\Service\ServiceSubscriberInterface" was found in
both "vendor/symfony/service-contracts/ServiceSubscriberInterface.php"
and "vendor/symfony/contracts/Service/ServiceSubscriberInterface.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\Service\ResetInterface" was found in
both "vendor/symfony/service-contracts/ResetInterface.php"
and "vendor/symfony/contracts/Service/ResetInterface.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\Service\ServiceProviderInterface" was found in
both "vendor/symfony/service-contracts/ServiceProviderInterface.php"
and "vendor/symfony/contracts/Service/ServiceProviderInterface.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\Service\ServiceSubscriberTrait" was found in
both "vendor/symfony/service-contracts/ServiceSubscriberTrait.php"
and "vendor/symfony/contracts/Service/ServiceSubscriberTrait.php", the first will be used.
Warning: Ambiguous class resolution, "Symfony\Contracts\Service\ServiceLocatorTrait" was found in
both "vendor/symfony/service-contracts/ServiceLocatorTrait.php"
and "vendor/symfony/contracts/Service/ServiceLocatorTrait.php", the first will be used.
Symfony framework will load some traits and interfaces from symfony/*-contracts
while this bundle will try to load the same but from symfony/contracts
No other dependencies are using this package :
$ composer why symfony/contracts
sylius/theme-bundle v1.4.6 requires symfony/contracts (^1.0)
So required packages have to be change to this list maybe :
"symfony/cache-contracts": "^1.0"
"symfony/translation-contracts": "^1.0"
"symfony/event-dispatcher-contracts": "^1.0"
"symfony/service-contracts": "^1.0"
Q | A |
---|---|
Bug report? | yes |
Feature request? | yes |
BC Break report? | no |
RFC? | yes |
Sylius version | 1.0.7 |
After making sure framework.assets.base_urls
is used in the ThemeBundle, I found out today that the imagine_filter
is still generating URL's based on the app's base URL, and not on the defined asset URL. This is something ImagineBundle itself also doesn't support, so it's not strictly a Sylius bug. Though, it prevents full usage of a CDN inside Sylius out of the box.
I didn't get a working solution yet to decorate the WebPathResolver
of ImagineBundle. While trying to decorate I wanted to use the UrlPackage of the theme, but due to being an abstract service I couldn't inject that one in the decorator. Another issue is that the setting of the web_path
resolver are resolved and injected again in a compiler pass of ImagineBundle, making it harder to get their values in the decorator class. Anyway, not that easy to get an easy fix for this.
Another option is to define a custom resolver for Sylius, which does the work. Still having issues with certain configurations, but it allows for more customisation and own injection points.
I have a route mapped to a template name
shop_domaines_show:
path: /domaines/{slug}
defaults:
_controller: black_sylius_marketplace.controller.seller:showAction
_sylius:
template: 'Shop/views/domaines/show.html.twig'
repository:
method: findOneBySlug
arguments:
- $slug
And a template in templates/Shop/views/domaines/show.html.twig
It works ok.
When I want to override this template in the theme it fails.
I put a new file in themes/MyTheme/Shop/views/domaines/show.html.twig
And it's not loaded.
If I remove the template in the templates
dir, leaving only the one in the theme, here is the error I get :
Unable to find template "Shop/views/domaines/show.html.twig" (looked into: /project/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views, /project/templates, /project/templates, /project/vendor/symfony/twig-bridge/Resources/views/Form).
The loader is not looking in the theme directory. Note it seems to be looking twice in the /project/templates
dir.
The problem only occurs for app templates.
Bundle templates are loaded fine from the theme directory. (/theme/MyTheme/SyliusShopBundle/views/Homepage/index.html.twig
works perfetcly)
The theme is enabled of course
I'm using Sylius 1.8 and sylius/theme-bundle 1.5.1
Same issue as v2.7.3
Command sylius:theme:assets:install --symlink --relative
removes some origin files when executed after executing the standard assets:install --symlink --relative
command.
I think the problem is originated when $target
is a symlink to $origin
at:
Not sure how to fix.
#!/bin/bash
composer create-project symfony/website-skeleton foobar ^4
cd foobar
sed -i 's/assets:install/assets:install --symlink --relative/g' composer.json
sed -i 's/"allow-contrib": false/"allow-contrib": true/g' composer.json
composer require friendsofsymfony/jsrouting-bundle
composer require sylius/theme-bundle
bin/console sylius:theme:assets:install --symlink --relative
Creating a "symfony/website-skeleton" project at "./foobar"
Installing symfony/website-skeleton (v4.4.99)
- Installing symfony/website-skeleton (v4.4.99): Extracting archive
Created project in /tmp/foobar
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
- Locking symfony/flex (v1.11.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing symfony/flex (v1.11.0): Extracting archive
Symfony operations: 1 recipe (3e5a687e9de0045b7783045f10652945)
- Configuring symfony/flex (>=1.0): From github.com/symfony/recipes:master
Loading composer repositories with package information
Updating dependencies
Restricting packages listed in "symfony/symfony" to "4.4.*"
Lock file operations: 105 installs, 0 updates, 0 removals
- Locking composer/package-versions-deprecated (1.11.99.1)
- Locking doctrine/annotations (1.11.1)
- Locking doctrine/cache (1.10.2)
- Locking doctrine/collections (1.6.7)
- Locking doctrine/common (3.1.0)
- Locking doctrine/dbal (2.12.1)
- Locking doctrine/doctrine-bundle (2.2.2)
- Locking doctrine/doctrine-migrations-bundle (3.0.1)
- Locking doctrine/event-manager (1.1.1)
- Locking doctrine/inflector (2.0.3)
- Locking doctrine/instantiator (1.4.0)
- Locking doctrine/lexer (1.2.1)
- Locking doctrine/migrations (3.0.1)
- Locking doctrine/orm (2.8.1)
- Locking doctrine/persistence (2.1.0)
- Locking doctrine/sql-formatter (1.1.1)
- Locking egulias/email-validator (2.1.24)
- Locking laminas/laminas-code (3.5.1)
- Locking laminas/laminas-eventmanager (3.3.0)
- Locking laminas/laminas-zendframework-bridge (1.1.1)
- Locking monolog/monolog (1.26.0)
- Locking nikic/php-parser (v4.10.3)
- Locking ocramius/proxy-manager (2.10.0)
- Locking phpdocumentor/reflection-common (2.2.0)
- Locking phpdocumentor/reflection-docblock (5.2.2)
- Locking phpdocumentor/type-resolver (1.4.0)
- Locking psr/cache (1.0.1)
- Locking psr/container (1.0.0)
- Locking psr/link (1.0.0)
- Locking psr/log (1.1.3)
- Locking sensio/framework-extra-bundle (v5.6.1)
- Locking symfony/asset (v4.4.17)
- Locking symfony/browser-kit (v4.4.17)
- Locking symfony/cache (v4.4.17)
- Locking symfony/cache-contracts (v2.2.0)
- Locking symfony/config (v4.4.17)
- Locking symfony/console (v4.4.17)
- Locking symfony/css-selector (v4.4.17)
- Locking symfony/debug (v4.4.17)
- Locking symfony/debug-bundle (v4.4.17)
- Locking symfony/debug-pack (v1.0.9)
- Locking symfony/dependency-injection (v4.4.17)
- Locking symfony/deprecation-contracts (v2.2.0)
- Locking symfony/doctrine-bridge (v4.4.17)
- Locking symfony/dom-crawler (v4.4.17)
- Locking symfony/dotenv (v4.4.17)
- Locking symfony/error-handler (v4.4.17)
- Locking symfony/event-dispatcher (v4.4.17)
- Locking symfony/event-dispatcher-contracts (v1.1.9)
- Locking symfony/expression-language (v4.4.17)
- Locking symfony/filesystem (v4.4.17)
- Locking symfony/finder (v4.4.17)
- Locking symfony/form (v4.4.17)
- Locking symfony/framework-bundle (v4.4.17)
- Locking symfony/http-client (v4.4.17)
- Locking symfony/http-client-contracts (v2.3.1)
- Locking symfony/http-foundation (v4.4.17)
- Locking symfony/http-kernel (v4.4.17)
- Locking symfony/inflector (v4.4.17)
- Locking symfony/intl (v4.4.17)
- Locking symfony/mailer (v4.4.17)
- Locking symfony/maker-bundle (v1.25.0)
- Locking symfony/mime (v4.4.17)
- Locking symfony/monolog-bridge (v4.4.17)
- Locking symfony/monolog-bundle (v3.6.0)
- Locking symfony/options-resolver (v4.4.17)
- Locking symfony/orm-pack (v2.0.0)
- Locking symfony/phpunit-bridge (v5.2.0)
- Locking symfony/polyfill-intl-icu (v1.20.0)
- Locking symfony/polyfill-intl-idn (v1.20.0)
- Locking symfony/polyfill-intl-normalizer (v1.20.0)
- Locking symfony/polyfill-mbstring (v1.20.0)
- Locking symfony/polyfill-php72 (v1.20.0)
- Locking symfony/polyfill-php73 (v1.20.0)
- Locking symfony/polyfill-php80 (v1.20.0)
- Locking symfony/process (v4.4.17)
- Locking symfony/profiler-pack (v1.0.5)
- Locking symfony/property-access (v4.4.17)
- Locking symfony/property-info (v4.4.17)
- Locking symfony/routing (v4.4.17)
- Locking symfony/security-bundle (v4.4.17)
- Locking symfony/security-core (v4.4.17)
- Locking symfony/security-csrf (v4.4.17)
- Locking symfony/security-guard (v4.4.17)
- Locking symfony/security-http (v4.4.17)
- Locking symfony/serializer (v4.4.17)
- Locking symfony/serializer-pack (v1.0.4)
- Locking symfony/service-contracts (v2.2.0)
- Locking symfony/stopwatch (v4.4.17)
- Locking symfony/test-pack (v1.0.7)
- Locking symfony/translation (v4.4.17)
- Locking symfony/translation-contracts (v2.3.0)
- Locking symfony/twig-bridge (v4.4.17)
- Locking symfony/twig-bundle (v4.4.17)
- Locking symfony/twig-pack (v1.0.1)
- Locking symfony/validator (v4.4.17)
- Locking symfony/var-dumper (v4.4.17)
- Locking symfony/var-exporter (v4.4.17)
- Locking symfony/web-link (v4.4.17)
- Locking symfony/web-profiler-bundle (v4.4.17)
- Locking symfony/yaml (v4.4.17)
- Locking twig/extra-bundle (v3.1.1)
- Locking twig/twig (v3.1.1)
- Locking webimpress/safe-writer (2.1.0)
- Locking webmozart/assert (1.9.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 105 installs, 0 updates, 0 removals
- Installing composer/package-versions-deprecated (1.11.99.1): Extracting archive
- Installing doctrine/cache (1.10.2): Extracting archive
- Installing doctrine/collections (1.6.7): Extracting archive
- Installing doctrine/event-manager (1.1.1): Extracting archive
- Installing doctrine/lexer (1.2.1): Extracting archive
- Installing doctrine/annotations (1.11.1): Extracting archive
- Installing doctrine/persistence (2.1.0): Extracting archive
- Installing doctrine/common (3.1.0): Extracting archive
- Installing doctrine/instantiator (1.4.0): Extracting archive
- Installing psr/container (1.0.0): Extracting archive
- Installing symfony/service-contracts (v2.2.0): Extracting archive
- Installing symfony/stopwatch (v4.4.17): Extracting archive
- Installing symfony/polyfill-php80 (v1.20.0): Extracting archive
- Installing symfony/polyfill-php73 (v1.20.0): Extracting archive
- Installing symfony/polyfill-mbstring (v1.20.0): Extracting archive
- Installing symfony/console (v4.4.17): Extracting archive
- Installing psr/log (1.1.3): Extracting archive
- Installing webimpress/safe-writer (2.1.0): Extracting archive
- Installing laminas/laminas-zendframework-bridge (1.1.1): Extracting archive
- Installing laminas/laminas-eventmanager (3.3.0): Extracting archive
- Installing laminas/laminas-code (3.5.1): Extracting archive
- Installing ocramius/proxy-manager (2.10.0): Extracting archive
- Installing doctrine/dbal (2.12.1): Extracting archive
- Installing doctrine/migrations (3.0.1): Extracting archive
- Installing doctrine/sql-formatter (1.1.1): Extracting archive
- Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
- Installing phpdocumentor/type-resolver (1.4.0): Extracting archive
- Installing symfony/polyfill-php72 (v1.20.0): Extracting archive
- Installing symfony/polyfill-intl-normalizer (v1.20.0): Extracting archive
- Installing symfony/polyfill-intl-idn (v1.20.0): Extracting archive
- Installing symfony/mime (v4.4.17): Extracting archive
- Installing symfony/http-foundation (v4.4.17): Extracting archive
- Installing symfony/http-client-contracts (v2.3.1): Extracting archive
- Installing symfony/event-dispatcher-contracts (v1.1.9): Extracting archive
- Installing symfony/event-dispatcher (v4.4.17): Extracting archive
- Installing symfony/var-dumper (v4.4.17): Extracting archive
- Installing symfony/debug (v4.4.17): Extracting archive
- Installing symfony/error-handler (v4.4.17): Extracting archive
- Installing symfony/http-kernel (v4.4.17): Extracting archive
- Installing symfony/routing (v4.4.17): Extracting archive
- Installing symfony/finder (v4.4.17): Extracting archive
- Installing symfony/filesystem (v4.4.17): Extracting archive
- Installing symfony/dependency-injection (v4.4.17): Extracting archive
- Installing symfony/config (v4.4.17): Extracting archive
- Installing symfony/var-exporter (v4.4.17): Extracting archive
- Installing psr/cache (1.0.1): Extracting archive
- Installing symfony/cache-contracts (v2.2.0): Extracting archive
- Installing symfony/cache (v4.4.17): Extracting archive
- Installing symfony/framework-bundle (v4.4.17): Extracting archive
- Installing sensio/framework-extra-bundle (v5.6.1): Extracting archive
- Installing symfony/asset (v4.4.17): Extracting archive
- Installing twig/twig (v3.1.1): Extracting archive
- Installing symfony/translation-contracts (v2.3.0): Extracting archive
- Installing symfony/twig-bridge (v4.4.17): Extracting archive
- Installing symfony/twig-bundle (v4.4.17): Extracting archive
- Installing symfony/web-profiler-bundle (v4.4.17): Extracting archive
- Installing symfony/profiler-pack (v1.0.5): Extracting archive
- Installing monolog/monolog (1.26.0): Extracting archive
- Installing symfony/monolog-bridge (v4.4.17): Extracting archive
- Installing symfony/monolog-bundle (v3.6.0): Extracting archive
- Installing symfony/debug-bundle (v4.4.17): Extracting archive
- Installing symfony/debug-pack (v1.0.9): Extracting archive
- Installing symfony/doctrine-bridge (v4.4.17): Extracting archive
- Installing symfony/dom-crawler (v4.4.17): Extracting archive
- Installing symfony/dotenv (v4.4.17): Extracting archive
- Installing symfony/expression-language (v4.4.17): Extracting archive
- Installing symfony/inflector (v4.4.17): Extracting archive
- Installing symfony/property-access (v4.4.17): Extracting archive
- Installing symfony/options-resolver (v4.4.17): Extracting archive
- Installing symfony/intl (v4.4.17): Extracting archive
- Installing symfony/polyfill-intl-icu (v1.20.0): Extracting archive
- Installing symfony/form (v4.4.17): Extracting archive
- Installing symfony/http-client (v4.4.17): Extracting archive
- Installing egulias/email-validator (2.1.24): Extracting archive
- Installing symfony/mailer (v4.4.17): Extracting archive
- Installing symfony/deprecation-contracts (v2.2.0): Extracting archive
- Installing nikic/php-parser (v4.10.3): Extracting archive
- Installing doctrine/inflector (2.0.3): Extracting archive
- Installing symfony/maker-bundle (v1.25.0): Extracting archive
- Installing doctrine/orm (2.8.1): Extracting archive
- Installing doctrine/doctrine-bundle (2.2.2): Extracting archive
- Installing doctrine/doctrine-migrations-bundle (3.0.1): Extracting archive
- Installing symfony/orm-pack (v2.0.0): Extracting archive
- Installing symfony/process (v4.4.17): Extracting archive
- Installing symfony/security-core (v4.4.17): Extracting archive
- Installing symfony/security-http (v4.4.17): Extracting archive
- Installing symfony/security-guard (v4.4.17): Extracting archive
- Installing symfony/security-csrf (v4.4.17): Extracting archive
- Installing symfony/security-bundle (v4.4.17): Extracting archive
- Installing symfony/serializer (v4.4.17): Extracting archive
- Installing symfony/property-info (v4.4.17): Extracting archive
- Installing webmozart/assert (1.9.1): Extracting archive
- Installing phpdocumentor/reflection-docblock (5.2.2): Extracting archive
- Installing symfony/serializer-pack (v1.0.4): Extracting archive
- Installing symfony/phpunit-bridge (v5.2.0): Extracting archive
- Installing symfony/css-selector (v4.4.17): Extracting archive
- Installing symfony/browser-kit (v4.4.17): Extracting archive
- Installing symfony/test-pack (v1.0.7): Extracting archive
- Installing symfony/translation (v4.4.17): Extracting archive
- Installing twig/extra-bundle (v3.1.1): Extracting archive
- Installing symfony/twig-pack (v1.0.1): Extracting archive
- Installing symfony/validator (v4.4.17): Extracting archive
- Installing psr/link (1.0.0): Extracting archive
- Installing symfony/web-link (v4.4.17): Extracting archive
- Installing symfony/yaml (v4.4.17): Extracting archive
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
91 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Symfony operations: 18 recipes (3e5a687e9de0045b7783045f10652945)
- Configuring symfony/framework-bundle (>=4.4): From github.com/symfony/recipes:master
- Configuring doctrine/annotations (>=1.0): From github.com/symfony/recipes:master
- Configuring symfony/console (>=4.4): From github.com/symfony/recipes:master
- Configuring symfony/routing (>=4.2): From github.com/symfony/recipes:master
- Configuring sensio/framework-extra-bundle (>=5.2): From github.com/symfony/recipes:master
- Configuring symfony/twig-bundle (>=4.4): From github.com/symfony/recipes:master
- Configuring symfony/web-profiler-bundle (>=3.3): From github.com/symfony/recipes:master
- Configuring symfony/monolog-bundle (>=3.3): From github.com/symfony/recipes:master
- Configuring symfony/debug-bundle (>=4.1): From github.com/symfony/recipes:master
- Configuring symfony/mailer (>=4.3): From github.com/symfony/recipes:master
- Configuring symfony/maker-bundle (>=1.0): From github.com/symfony/recipes:master
- Configuring doctrine/doctrine-bundle (>=2.0): From github.com/symfony/recipes:master
- Configuring doctrine/doctrine-migrations-bundle (>=2.2): From github.com/symfony/recipes:master
- Configuring symfony/security-bundle (>=4.4): From github.com/symfony/recipes:master
- Configuring symfony/phpunit-bridge (>=4.3): From github.com/symfony/recipes:master
- Configuring symfony/translation (>=3.3): From github.com/symfony/recipes:master
- Configuring twig/extra-bundle (>=v3.1.1): From auto-generated recipe
- Configuring symfony/validator (>=4.3): From github.com/symfony/recipes:master
Executing script cache:clear [OK]
Executing script assets:install public [OK]
Some files may have been created or updated to configure your new packages.
Please review, edit and commit them: these files are yours.
Some files may have been created or updated to configure your new packages.
Please review, edit and commit them: these files are yours.
What's next?
* Run your application:
1. Go to the project directory
2. Create your code repository with the git init command
3. Download the Symfony CLI at https://symfony.com/download to install a development web server
* Read the documentation at https://symfony.com/doc
What's next?
* You're ready to send emails.
* If you want to send emails via a supported email provider, install
the corresponding bridge.
For instance, composer require mailgun-mailer for Mailgun.
* If you want to send emails asynchronously:
1. Install the messenger component by running composer require messenger;
2. Add 'Symfony\Component\Mailer\Messenger\SendEmailMessage': amqp to the
config/packages/messenger.yaml file under framework.messenger.routing
and replace amqp with your transport name of choice.
* Read the documentation at https://symfony.com/doc/master/mailer.html
Database Configuration
* Modify your DATABASE_URL config in .env
* Configure the driver (mysql) and
server_version (5.7) in config/packages/doctrine.yaml
How to test?
* Write test cases in the tests/ folder
* Run php bin/phpunit
Using version ^2.7 for friendsofsymfony/jsrouting-bundle
./composer.json has been updated
Running composer update friendsofsymfony/jsrouting-bundle
Loading composer repositories with package information
Updating dependencies
Lock file operations: 2 installs, 0 updates, 0 removals
- Locking friendsofsymfony/jsrouting-bundle (2.7.0)
- Locking willdurand/jsonp-callback-validator (v1.1.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
- Installing willdurand/jsonp-callback-validator (v1.1.0): Extracting archive
- Installing friendsofsymfony/jsrouting-bundle (2.7.0): Extracting archive
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
85 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Symfony operations: 1 recipe (c6f400a6717b397a7ee90754932a7e05)
- Configuring friendsofsymfony/jsrouting-bundle (>=2.3): From github.com/symfony/recipes-contrib:master
Executing script cache:clear [OK]
Executing script assets:install --symlink --relative public [OK]
Some files may have been created or updated to configure your new packages.
Please review, edit and commit them: these files are yours.
Nothing to unpack
Using version ^2.1 for sylius/theme-bundle
./composer.json has been updated
Running composer update sylius/theme-bundle
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
- Locking sylius/theme-bundle (v2.1.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Installing sylius/theme-bundle (v2.1.0): Extracting archive
Generating autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
85 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Symfony operations: 1 recipe (1679ac13f95a548876bd279532f14a8d)
- Configuring sylius/theme-bundle (>=v2.1.0): From auto-generated recipe
Executing script cache:clear [OK]
Executing script assets:install --symlink --relative public [OK]
Some files may have been created or updated to configure your new packages.
Please review, edit and commit them: these files are yours.
Nothing to unpack
Trying to install assets as symbolic links.
In Filesystem.php line 45:
Failed to copy "/tmp/foobar/vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router.js" because file does not exist.
sylius:theme:assets:install [--symlink] [--relative] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<target>]
Please make bundle installable on PHP8 runtime.
Most of the time it's good enough to add ||^8.0
to the composer.json
. But list of breaking changes should be checked, obviously.
With Sylius 1.9.0 and sylius/theme-bundle
2.1.1, when I run the bin/console sylius:theme:assets:install
command (without symlinks due to #79), I am not getting a version of the assets in the public/_themes
directory. public/bundles
does generate correctly.
For our client, we overloaded some admin field types to use CKEditor through FOSCKEditorBundle
and are installing its assets via bin/console ckeditor:install --clear=drop
. After running the CKEditor install command then the asset install command and going to any admin page where we have CKEditor in use, the asset URL (as determined with the PathResolver
class) is /_themes/<theme_composer_name>/bundles/fosckeditor/ckeditor.js
. With Sylius 1.8 and the 1.x version of this bundle, the asset URL is /bundles/_themes/<theme_composer_name>/fosckeditor/ckeditor.js
and this is working OK (note, public/bundles/_themes
doesn't exist on the new version either, just to be sure there wasn't anything strange here).
Symfony has added code to the framework to support bundles having a folder structure similar to applications (so instead of Resources/config
, you have a root config
directory; similar for Resources/public
, Resources/views
, etc.).
The core assets:install
command includes support for discovering public assets in a bundle's Resources/public
or public
directory. The AssetsProvider
class for this bundle only supports the Resources/public
directory, meaning the sylius:theme:assets:install
command is not compatible with the bundle structure changes from Symfony itself.
This bundle should be updated to support the new path conventions from the framework.
(FWIW, in PagerfantaBundle 3.0, I am using the updated conventions so this would be an example of a bundle whose public assets wouldn't be discovered/installed)
vendor | version |
---|---|
PHP | 8.0.14 |
Symfony/Symfony | 5.4.2, 5.3.13 |
Sylius/SyliusThemeBundle | 2.2.0 |
sulu/SuluThemeBundle | 3.0.2 |
As soon as I'm using render_esi in a template, I get a changed default language (defaultlocale@theme-name) in the symfony profiler.
{{ render_esi(controller('App\\Controller\\Website\\PageController::testPage', {
'_portal' : request.portalKey|default('default_portal_key'),
'_locale' : app.request.locale,
'message': 'foo bar'
})) }}
That's weird and symfony is using the correct selected language as fallback.
If I remove render_esi from the template all works fine.
Hello,
I wanted an idempotent cache but the translator uses the cache dynamically. In Symfony you can redefine the cache_dir in configuration, but this configuration is ignored by this bundle and overrided to the default cache directory.
I used this code as a workaround that will not work with the master branch of the bundle:
class IdempotentCachePass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
$definition = $container->getDefinition('sylius.theme.translation.translator');
$defaultOptions = $definition->getArgument(4);
$defaultOptions['cache_dir'] = $container->getParameter('kernel.tmp_dir');
$definition->setArgument(4, $defaultOptions);
}
}
Since last fix, when I want to update my Sylius project with composer, there is an error when I clear cache :
Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 1 passed to Symfony\Component\Translation\LoggingTranslator::__construct() must implement interface Symfony\Component\Translation\TranslatorInterface, instance of Sylius\Bundle\ThemeBundle\Translation\ThemeAwareTranslator given, called in /apps/sylius/var/cache/dev/ContainerO9zxhet/srcDevDebugProjectContainer.php on line 5618 in /apps/sylius/vendor/symfony/symfony/src/Symfony/Component/Translation/LoggingTranslator.php:33
It seems that there is no compatibility check between versions of symfony, and that the minimum version required is 4.2.7.
To fix it, I have to add conflict on my composer.json
"conflict": { "sylius/theme-bundle": "1.4.5" },
Thanks !
It sometimes happens that we use symlink for translation folders (when shared across multiple servers ie.)
If done, then translations are not fetched at all by themeBundle.
Possible solution:
Allow to browse symlink when searching translations
symfony/symfony:^4.4
requires "symfony/contracts": "^1.1.8"
(https://github.com/symfony/symfony/blob/4.4/composer.json#L28) thus resulting in following error:
Declaration of Sylius\Bundle\ThemeBundle\Translation\ThemeAwareTranslator::trans(string $id, array $parameters = Array, ?string $domain = NULL, ?string $locale = NULL): string must be compatible with Symfony\Contracts\Translation\TranslatorInterface::trans($id, array $parameters = Array, $domain = NULL, $locale = NULL) in /var/www/html/vendor/sylius/theme-bundle/src/Translation/ThemeAwareTranslator.php on line 65
Test are running for you, cause you don't install full symfony/symfony resulting in the installation of symfony/translation-contracts
in Version 2.x which works.
Preview Issue : Sylius/Sylius#10269
I didn't check if it was corrected but I don't want to loose it.
Sylius version affected: 1.2.4
Newer versions should be impacted.
Description
The first load of sylius is crazy slow.
Steps to reproduce
Put 22k files into your theme, in many directories (like a node_modules/).
Possible Solution
The function which is causing the "issue" is:
\Sylius\Bundle\ThemeBundle\Translation\Finder\TranslationFilesFinder::findTranslationFiles
public function findTranslationFiles(string $path): array
{
$themeFiles = $this->getFiles($path);
$translationsFiles = [];
foreach ($themeFiles as $themeFile) {
$themeFilepath = (string) $themeFile;
if (!$this->isTranslationFile($themeFilepath)) {
continue;
}
$translationsFiles[] = $themeFilepath;
}
return $translationsFiles;
}
We found out that trying to find all the translation files in a node_modules/ directory can be very painful.
The discussion on Slack starts here: https://sylius-devs.slack.com/archives/C5K44R5GU/p1553722188005300
A related PR: Sylius/Sylius#9013
Some solutions:
The good thing is that we can implement all these solutions and it will be amazing!
Thank you 💪 ❤️
Similar to what Sylius does with the channel toolbar.
What to do?
In Symfony 5.2
$options = $symfonyTranslator->getArgument(3);
in
Symfony\Component\DependencyInjection\Argument\AbstractArgument
. Therefore, the following condition
if (!array_key_exists('resource_files', $options))
gives a depracation warning (https://wiki.php.net/rfc/deprecations_php_7_4#array_key_exists_with_objects)
I have created my own custom theme (eg CrimsonTheme) with a third party css-framework and I need to override the templates from the UiBundle (eg Grid); I could put my templates in this location themes/CrimsonTheme/templates/bundles/SyliusUiBundle
as stated in the documentation, but this bundle is shared by the default theme for both the shop and the admin UI, so I need a different approach where my new shared templates will only be available for my custom themes, how can I organize this?
the command sylius:theme:assets:install is missing because the services.xml doesn't indicate where to load the xml files into integrations directory.
please add
<import resource="services/integrations/*.xml" />
The issue to track and coordinate efforts.
Starting from the 1.1
branch.
I have installed fresh new Sulu
project and installed Sulu Theme
bundle which uses Sylius Theme
bundle.
I ran php bin/console sylius:theme:assets:install
and command fails with error:
Failed to create "symbolic" link from "my-project2/vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router.js" to "public/bundles/fosjsrouting/js/router.js": symlink(): No such file or directory
However in my-project2/vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/
folder there is only router.min.js
file.
HI Everyone!,
I followed the paid course at lesson 7. add the package.json but when I tried to get the admin page I got this error
The child config "name" under "sylius_theme" must be configured.
thank you for you help
I have controller /src/Controller/Product/ProductGridController, and template for him /templates/Product/list.html.twig ($this->render('Product/list.html.twig', [])). Also I have one theme, and I try to override my app template list.html.twig in this theme by /themes/CustomTheme/templates/Product/list.html.twig, but it is not working! How to I can override my template?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.