Skip to content

Allow 3rd-party applications to operate in get.php scope #599

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

Merged
merged 1 commit into from
May 22, 2019
Merged

Allow 3rd-party applications to operate in get.php scope #599

merged 1 commit into from
May 22, 2019

Conversation

ericturner1
Copy link
Contributor

Sometimes it might be useful to allow third-party modules to operate in the get.php scope. To accommodate this, a configuration point called 'loaded_modules' is added, into which third-party modules may register, thereby allowing their classes to be loaded during requests to get.php.

@LeeSaferite
Copy link
Contributor

I'm not sure I get what this is meant to allow. Could you explain it to me?

@colinmollenhour
Copy link
Member

get.php avoids loading the full Magento environment by caching a few key pieces of information in resource_config.json. When this file is present it calls Mage::init with the third and fourth arguments so only Mage_Core is loaded and not the gazillion other extensions. However, some third-party extensions might need to be loaded in order to override core functionality. An example is Thai_S3 which we've been working on integrating. When the media file is missing from the local media directory and it must fetch the file off of S3 it needs to do so using the Thai_S3 rewritten classes but since Magento is initialized with only Mage_Core the Thai/S3/etc/config.xml is never loaded so the rewrites are not in effect. This PR makes the list of extensions which are necessary for get.php to work to be configurable. The list of modules to load is persisted in resource_config.json and then used to inform the partial-init.

@LeeSaferite LeeSaferite self-requested a review February 10, 2019 04:44
@colinmollenhour colinmollenhour merged commit b559b6f into OpenMage:1.9.3.x May 22, 2019
@colinmollenhour
Copy link
Member

Also cherry-picked onto 1.9.4.x

edannenberg pushed a commit to edannenberg/magento-lts that referenced this pull request Aug 22, 2019
…p scope

get.php avoids loading the full Magento environment by caching a few
key pieces of information in resource_config.json. When this file is
present it calls Mage::init with the third and fourth arguments so
only Mage_Core is loaded and not the gazillion other extensions.

However, some third-party extensions might need to be loaded in order
to override core functionality. An example is Thai_S3 which we've
been working on integrating. When the media file is missing from the
local media directory and it must fetch the file off of S3 it needs
to do so using the Thai_S3 rewritten classes but since Magento is
initialized with only Mage_Core the Thai/S3/etc/config.xml is never
loaded so the rewrites are not in effect. This PR makes the list of
extensions which are necessary for get.php to work to be configurable.
The list of modules to load is persisted in resource_config.json and
then used to inform the partial-init.
edannenberg pushed a commit to edannenberg/magento-lts that referenced this pull request Oct 25, 2019
…p scope

get.php avoids loading the full Magento environment by caching a few
key pieces of information in resource_config.json. When this file is
present it calls Mage::init with the third and fourth arguments so
only Mage_Core is loaded and not the gazillion other extensions.

However, some third-party extensions might need to be loaded in order
to override core functionality. An example is Thai_S3 which we've
been working on integrating. When the media file is missing from the
local media directory and it must fetch the file off of S3 it needs
to do so using the Thai_S3 rewritten classes but since Magento is
initialized with only Mage_Core the Thai/S3/etc/config.xml is never
loaded so the rewrites are not in effect. This PR makes the list of
extensions which are necessary for get.php to work to be configurable.
The list of modules to load is persisted in resource_config.json and
then used to inform the partial-init.
edannenberg pushed a commit to edannenberg/magento-lts that referenced this pull request Aug 20, 2020
…p scope

get.php avoids loading the full Magento environment by caching a few
key pieces of information in resource_config.json. When this file is
present it calls Mage::init with the third and fourth arguments so
only Mage_Core is loaded and not the gazillion other extensions.

However, some third-party extensions might need to be loaded in order
to override core functionality. An example is Thai_S3 which we've
been working on integrating. When the media file is missing from the
local media directory and it must fetch the file off of S3 it needs
to do so using the Thai_S3 rewritten classes but since Magento is
initialized with only Mage_Core the Thai/S3/etc/config.xml is never
loaded so the rewrites are not in effect. This PR makes the list of
extensions which are necessary for get.php to work to be configurable.
The list of modules to load is persisted in resource_config.json and
then used to inform the partial-init.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants