Code Monkey home page Code Monkey logo

Comments (5)

GrahamCampbell avatar GrahamCampbell commented on June 26, 2024

No, there are no built-ins, but there may be variables already set outside of your env file that can be access from it.

from phpdotenv.

GrahamCampbell avatar GrahamCampbell commented on June 26, 2024

Some that are resolved from $_SERVER: https://www.php.net/manual/en/reserved.variables.server.php.

from phpdotenv.

treii28 avatar treii28 commented on June 26, 2024

yeah, it will contain a PWD, but when I played with that one, it tells you the directory of the calling script, not the location of the .env file. I already had a method -- since the calling scripts are generally going to be 'under' the project root -- that will search-up the current path until it finds a .env (in my case, I also confirm with other directories/files such a vendor and composer). But that too can be unreliable as dev environments often use symlinks for local packages who's source code is under a different path.
I was just curious before hardcoding a parameter in every installations .env file. It just seems quirky to hard code a path that you then have to hard code again to read the environment file to get the path. And or to read an env file to set environment variables then have to set an environment variable of where you found the env file (or where root is). I thought maybe the path read might be stored somewhere.

from phpdotenv.

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.