Magento 2. Retrieve information from env.php programmaticallyMagento 2 - How to retrieve product informationswhat is entity when create an order using REST apiMagento 2. Create customer account programmatically with no password and confirmation requiredMagento 2 apply tax class programmatically to customerMagento 2 php bin/magento setup:install WITHOUT sample dataMagento 2.2: moving configs from config.php to env.php after app:config:dumpSystem-specific env.php values are included in database config snapshotColumn value display wrong when export CSV in magento 2 admin UI component grid in magento 2Magento 2. Retrieve information from env.php in the js files programmaticallyAdd additional text to email template container
Can attackers change the public key of certificate during the SSL handshake
Minimum effort to detect a solved Rubik's Cube
How to realistically deal with a shield user?
How to approach protecting my code as a research assistant? Should I be worried in the first place?
Why is Chromosome 1 called Chromosome 1?
Tile the chessboard with four-colored triominoes
Did WWII Japanese soldiers engage in cannibalism of their enemies?
How to check a file was encrypted (really & correctly)
Plato and the knowledge of the forms
Can chords be inferred from melody alone?
Did Apollo leave poop on the moon?
What could prevent players from leaving an island?
Is space radiation a risk for space film photography, and how is this prevented?
Write The Shortest Program To Check If A Binary Tree Is Balanced
The meaning of "scale" in "because diversions scale so easily wealth becomes concentrated"
Purchased new computer from DELL with pre-installed Ubuntu. Won't boot. Should assume its an error from DELL?
What does the ISO setting for mechanical 35mm film cameras actually do?
Can I enter a rental property without giving notice if I'm afraid a tenant may be hurt?
How to touch up scratches on a black anodized aluminum flashlight?
Why is the Vasa Museum in Stockholm so Popular?
Non-small objects in categories
Why do cheap flights with a layover get more expensive when you split them up into separate flights?
What prevents ads from reading my password as I type it?
Is "safes" an acceptable alternative to "makes safe"
Magento 2. Retrieve information from env.php programmatically
Magento 2 - How to retrieve product informationswhat is entity when create an order using REST apiMagento 2. Create customer account programmatically with no password and confirmation requiredMagento 2 apply tax class programmatically to customerMagento 2 php bin/magento setup:install WITHOUT sample dataMagento 2.2: moving configs from config.php to env.php after app:config:dumpSystem-specific env.php values are included in database config snapshotColumn value display wrong when export CSV in magento 2 admin UI component grid in magento 2Magento 2. Retrieve information from env.php in the js files programmaticallyAdd additional text to email template container
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I wish to read and use information stored in my env.php
. Is there an entity that I can use to achieve this?
Any tips are highly appreciated.
Thanks.
magento2 configuration
add a comment |
I wish to read and use information stored in my env.php
. Is there an entity that I can use to achieve this?
Any tips are highly appreciated.
Thanks.
magento2 configuration
add a comment |
I wish to read and use information stored in my env.php
. Is there an entity that I can use to achieve this?
Any tips are highly appreciated.
Thanks.
magento2 configuration
I wish to read and use information stored in my env.php
. Is there an entity that I can use to achieve this?
Any tips are highly appreciated.
Thanks.
magento2 configuration
magento2 configuration
asked Mar 2 '18 at 13:23
vitoriodachefvitoriodachef
1,5284 silver badges29 bronze badges
1,5284 silver badges29 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Have a look at MagentoFrameworkAppDeploymentConfig
:
Inject a deployment config object of MagentoFrameworkAppDeploymentConfig
in your code and then retrieve the value like this:
$deploymentConfig->get('db/connection/default/host'));
for example:
$deploymentConfig->get('your/custom/value'));
For default values, see Magento's deployment configuration.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f215778%2fmagento-2-retrieve-information-from-env-php-programmatically%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Have a look at MagentoFrameworkAppDeploymentConfig
:
Inject a deployment config object of MagentoFrameworkAppDeploymentConfig
in your code and then retrieve the value like this:
$deploymentConfig->get('db/connection/default/host'));
for example:
$deploymentConfig->get('your/custom/value'));
For default values, see Magento's deployment configuration.
add a comment |
Have a look at MagentoFrameworkAppDeploymentConfig
:
Inject a deployment config object of MagentoFrameworkAppDeploymentConfig
in your code and then retrieve the value like this:
$deploymentConfig->get('db/connection/default/host'));
for example:
$deploymentConfig->get('your/custom/value'));
For default values, see Magento's deployment configuration.
add a comment |
Have a look at MagentoFrameworkAppDeploymentConfig
:
Inject a deployment config object of MagentoFrameworkAppDeploymentConfig
in your code and then retrieve the value like this:
$deploymentConfig->get('db/connection/default/host'));
for example:
$deploymentConfig->get('your/custom/value'));
For default values, see Magento's deployment configuration.
Have a look at MagentoFrameworkAppDeploymentConfig
:
Inject a deployment config object of MagentoFrameworkAppDeploymentConfig
in your code and then retrieve the value like this:
$deploymentConfig->get('db/connection/default/host'));
for example:
$deploymentConfig->get('your/custom/value'));
For default values, see Magento's deployment configuration.
edited Jul 27 at 3:32
Erfan
2,60419 silver badges27 bronze badges
2,60419 silver badges27 bronze badges
answered Mar 2 '18 at 13:39
Anna VölklAnna Völkl
15.8k3 gold badges50 silver badges136 bronze badges
15.8k3 gold badges50 silver badges136 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f215778%2fmagento-2-retrieve-information-from-env-php-programmatically%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown