Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow autoloading in modules for services use in BO #8909

Merged

Conversation

@mickaelandrieu
Copy link
Member

commented Apr 2, 2018

Questions Answers
Branch? develop
Description? If you declare services in modules and if your module is using Composer as autoloader, the service container breaks during compilation because PrestaShop is unaware of classes inside the module (the module may not be instantiated when the service container is built).
Type? bug fix
Category? BO
BC breaks? no
Deprecations? no
How to test? Declare a service in one of your modules and try to access a "modern" Back Office page.

Important guidelines


This change is Reviewable

@@ -67,9 +67,16 @@ public function registerBundles()
* @see https://symfony.com/doc/2.8/configuration/external_parameters.html#environment-variables
*/
if (extension_loaded('apc')) {
$_SERVER['CACHE_DRIVER'] = 'apc';
$_SERVER['CACHE__DRIVER'] = 'apc';

This comment has been minimized.

Copy link
@jocel1

jocel1 Apr 2, 2018

Contributor

You'll need to change the %env(CACHE_DRIVER)% in the config_prod.yml as well

This comment has been minimized.

Copy link
@mickaelandrieu

mickaelandrieu Apr 2, 2018

Author Member

true, but isn't already the case?

edit: ok i got it I've done a typo :)

@mickaelandrieu mickaelandrieu force-pushed the mickaelandrieu:allow-autoloading-in-modules branch from 55c100b to 129ea34 Apr 2, 2018

I've reverted this typo, thanks

@Quetzacoalt91

This comment has been minimized.

Copy link
Member

commented Apr 4, 2018

Do you have a module example to provide to the QA team?

@mickaelandrieu

This comment has been minimized.

Copy link
Member Author

commented Apr 6, 2018

Sure => ps_test.zip

@mickaelandrieu

This comment has been minimized.

Copy link
Member Author

commented Apr 12, 2018

@Quetzacoalt91 do I need to do something here, or is it mergeable? :)

@Quetzacoalt91 Quetzacoalt91 merged commit 6657c06 into PrestaShop:develop Apr 13, 2018

2 checks passed

Codacy/PR Quality Review Good work! A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@mickaelandrieu mickaelandrieu deleted the mickaelandrieu:allow-autoloading-in-modules branch Apr 13, 2018

@eternoendless eternoendless added this to the 1.7.4.0 milestone Apr 13, 2018

@matks

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2019

Hi @mickaelandrieu, I'm wondering: why perform this step in AppKernel::registerBundles() ?

It's not a bad choice ... but it's supposed to register bundles, not enable autoloaders 😅?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.