In #1492 we changed the application to be compatible with Symfony Flex. You can read more about upgrading Symfony application to Flex https://symfony.com/doc/current/setup/flex.html
- copy
.env
and.env.test
files from GitHub into the root folder - add local environment files as ignored into
.gitignore
/docker-compose.yml
/docker-sync.yml
+ /.env.local
+ /.env.local.php
+ /.env.*.local
-
copy
symfony.lock
file from GitHub into the root folder -
copy
composer.json
file from GitHub into the root folder- add any project-specific dependencies
-
in
easy-coding-standard.yml
replace*/tests/ShopBundle/
with*/tests/App/
*/src/Shopsys/ShopBundle/
with*/src/
-
in
.eslintignore
removeShopsys/ShopBundle
from all paths -
replace
phpunit.xml
withphpunit.xml
version from GitHub -
replace
phpstan.neon
withphpstan.neon
version from GitHub- add any project-specific configurations
-
replace
build/codeception.yml
withbuild/codeception.yml
version from GitHub -
move the original source code from
src/Shopsys/ShopBundle/
tosrc/
and update the namespaces of every PHP file to beApp\...
(advanced IDEs can do this automatically) -
remove bundle related files as the application itself is no longer a bundle
src/Shopsys/ShopBundle/ShopsysShopBundle.php
src/Shopsys/ShopBundle/DependencyInjection/Configuration.php
src/Shopsys/ShopBundle/DependencyInjection/ShopsysShopExtension.php
-
update application bootstrapping:
- copy
src/Kernel.php
file from GitHub into thesrc
folder - delete
app/AppCache.php
,app/AppKernel.php
,app/router.php
, andBootstrap.php
as files are no longer necessary - change the namespace from
Shopsys
toApp
inapp/Environment.php
- replace
web/index.php
withweb/index.php
version from GitHub - replace
bin/console
withbin/console
version from GitHub
- copy
-
all configuration files are now located in the
config
folder exclusively- copy all config files to your project from the config folder from the new version
- merge your project-specific configurations from
app/config
andsrc/Shopsys/ShopBundle/resources/config
folders intoconfig
. Keep in mind, thatconfig.yml
,config_dev.yml
, andconfig_test.yml
should be deleted as they're no longer necessary- in
parameters_common.yaml
all extended entities inshopsys.entity_extension.map
have to have new namespaceApp\...
- some paths in
paths.yaml
have changed, so be extra careful when changing with your modifications - routing files (
routing.yml
,routing_dev.yml
, androuting_test.yml
) are no longer necessary - any project-specific routes have to be moved into
routes
,routes/dev
, orroutes/test
folders into a separate file - any project-specific form extensions have to be added into
config/forms.yaml
- any project-specific image configurations have to be added into
config/images.yaml
- any project-specific cron definitions have to be added into
config/services/cron.yaml
-
move templates from
src/Shopsys/ShopBundle/Resources/views/
totemplates/
folder -
remove
@ShopsysShop
Twig namespace in every template, eg.- {% extends '@ShopsysShop/Front/Layout/base.html.twig' %} - {% use '@ShopsysShop/Front/Layout/header.html.twig' %} + {% extends 'Front/Layout/base.html.twig' %} + {% use 'Front/Layout/header.html.twig' %}
-
remove
@ShopsysShop
Twig namespace from render methods in controllers, eg.- return $this->render('@ShopsysShop/Front/Content/Article/menu.html.twig', [ + return $this->render('Front/Content/Article/menu.html.twig', [ 'articles' => $articles, ]);
-
change rendering of embedded controllers in templates from three-part notation to standard string syntax for controllers, eg.
- {{ render(controller('ShopsysShopBundle:Front/Heureka:embedWidget')) }} + {{ render(controller('App\\Controller\\Front\\HeurekaController:embedWidgetAction')) }}
- Tip: you can use regular expression search for
ShopsysShopBundle:Front/(\w+):(\w+)
and replace withApp\\Controller\\Front\\$1Controller:$2Action
in Twig files
- Tip: you can use regular expression search for
-
update constant in
templates/Front/Content/Product/filterFormMacro.html.twig
{% if isSearch %} <input type="hidden" - name="{{ constant('Shopsys\\ShopBundle\\Controller\\Front\\ProductController::SEARCH_TEXT_PARAMETER') }}" + name="{{ constant('App\\Controller\\Front\\ProductController::SEARCH_TEXT_PARAMETER') }}"
-
change redirect/forward calls in controllers from three-part notation to fully qualified name, eg.
- return $this->forward('ShopsysShopBundle:Front/FlashMessage:index'); + return $this->forward(FlashMessageController::class . ':indexAction');
-
move overridden bundle templates from
app/Resources/views/
totemplates/bundle
(see more about template overriding https://symfony.com/doc/current/bundles/override.html#templates) -
move translation files from
src/Shopsys/ShopBundle/Resources/translations/
totranslations/
-
move rest of a files from
src/Shopsys/ShopBundle/Resources/
tosrc/Resources/
-
update Grunt template directory in
templates/Grunt/gruntfile.js.twig
(2 occurrences)destHtml: 'docs/generated', htmlDemo: true, - htmlDemoTemplate: '{{ customResourcesDirectory|raw }}/views/Grunt/htmlDocumentTemplate.html', + htmlDemoTemplate: '{{ gruntTemplateDirectory|raw }}/htmlDocumentTemplate.html', htmlDemoFilename: 'webfont-admin-svg',
-
update config file paths from
app/config
toconfig
in following files any others you may have create.ci/build_kubernetes.sh
.ci/deploy-to-google-cloud.sh
scripts/install.sh
kubernetes/kustomize/base/kustomization.yaml
-
change namespaces in
migrations-lock.yml
file fromShopsys\ShopBundle\...
toApp\...
, eg.20191114101504: - class: Shopsys\ShopBundle\Migrations\Version20191114101504 + class: App\Migrations\Version20191114101504 skip: false
-
move tests from
tests/ShopBundle/
totests/App/
and update the namespaces of every PHP file to beTests\App\...
(advanced IDEs can do this automatically) -
change namespace from
Tests\ShopBundle\...
toTests\App\...
in following filestests/App/Acceptance/acceptance.suite.yml
tests/App/Functional/Component/Javascript/Compiler/Constant/JsConstantCompilerPassTest.php
tests/App/Functional/Component/Javascript/Compiler/Constant/testClassName.expected.js
tests/App/Functional/Component/Javascript/Compiler/Constant/testClassName.js
tests/App/Functional/Component/Javascript/Compiler/Constant/testDefinedConstant.js
tests/App/Functional/Component/Javascript/Compiler/Constant/testUndefinedConstant.js
-
update
tests/App/Test/Codeception/Helper/SymfonyHelper.php
with the new Kernel class- use AppKernel; + use App\Kernel; use Codeception\Configuration; use Codeception\Module; ... { require_once Configuration::projectDir() . '/../app/autoload.php'; - $this->kernel = new AppKernel(EnvironmentType::TEST, EnvironmentType::isDebug(EnvironmentType::TEST)); + $this->kernel = new Kernel(EnvironmentType::TEST, EnvironmentType::isDebug(EnvironmentType::TEST)); $this->kernel->boot(); }
-
change namespace from
Shopsys/ShopBundle
toApp
in constants in following JS files and any others you createdsrc/Resources/scripts/frontend/cart/cartRecalculator.js
src/Resources/scripts/frontend/validation/form/customer.js
src/Resources/scripts/frontend/validation/form/order.js
src/Resources/scripts/frontend/promoCode.js
-
run
composer update