GithubHelp home page GithubHelp logo

Comments (11)

VBart avatar VBart commented on September 26, 2024 2

@bbak Such option is already there. Please see Unit 1.2 release notes: http://mailman.nginx.org/pipermail/unit/2018-June/000055.html

from unit.

igorsysoev avatar igorsysoev commented on September 26, 2024

from unit.

docteurklein avatar docteurklein commented on September 26, 2024

thanks for the quick answer!
Indeed they are but only via $_ENV. which is fine by me!
It differs however of the fcgi implementation (see http://php.net/manual/en/ini.core.php#ini.variables-order):

In both the CGI and FastCGI SAPIs, $_SERVER is also populated by values from the environment; S is always equivalent to ES regardless of the placement of E elsewhere in this directive.

Maybe it would worth add it in the docs to avoid potential head scratching?

from unit.

igorsysoev avatar igorsysoev commented on September 26, 2024

from unit.

bbak avatar bbak commented on September 26, 2024

IHMO there should also be an option to set ENV Variables per application.

Use case: When running multiple Symfony Applications (one for dev and one for testing) in one Instance of unit, you have to set the Environment Variable SYMFONY_ENV accordingly.

Additionally just making all Environment Variables from the master process available to all applications may lead into either massive overhead or a security problem.

from unit.

VBart avatar VBart commented on September 26, 2024

As of preventing passing env from the master process, I think that should be configurable.

from unit.

yannickgranger avatar yannickgranger commented on September 26, 2024

thanks for the quick answer!
Indeed they are but only via $_ENV. which is fine by me!
It differs however of the fcgi implementation (see http://php.net/manual/en/ini.core.php#ini.variables-order):

In both the CGI and FastCGI SAPIs, $_SERVER is also populated by values from the environment; S is always equivalent to ES regardless of the placement of E elsewhere in this directive.

Maybe it would worth add it in the docs to avoid potential head scratching?

@docteurklein when they are in $_ENV how do I get them used in the app ?

from unit.

VBart avatar VBart commented on September 26, 2024

@yannickgranger since previously you've asked about Symfony, then I assume that your question is about how to use such variables with Symfony: https://symfony.com/doc/current/configuration.html#configuration-based-on-environment-variables

from unit.

yannickgranger avatar yannickgranger commented on September 26, 2024

Yes and no. I followed here this thread and thought it was ok to have it in $_ENV. And looking at discussions in symfony pages, it's an old PHP issue.

Maybe i misconfigured Unit but I don't see how to grab the variable in config. If i set variable_orders: "ES" there's only $_ENV populated. The orm does not seems to "see" the env var DATABASE_URL in it's conf file when I pass it via unit json config.

      "environment": {
        "APP_ENV": "prod",
        "DATABASE_URL": "sqlite:///%kernel.project_dir%/var/data.db"
      },

from unit.

VBart avatar VBart commented on September 26, 2024

@yannickgranger I guess it doesn't interpolate it twice (i.e. recursive), so it sets your database url to sqlite:///%kernel.project_dir%/var/data.db without replacing %kernel.project_dir% to the actual path.

from unit.

VBart avatar VBart commented on September 26, 2024

Though it provides the resolve processor that will interpolate the value of $_ENV: https://symfony.com/doc/current/configuration/env_var_processors.html#built-in-environment-variable-processors

from unit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.