Comments (5)
I agree that this should be able to be escaped. I will definitely accept a PR to the v2
branch. I am about to do a v2.0.0 release, so get it in fast! ;)
from phpdotenv.
ok, i will send a PR today.
from phpdotenv.
I have send a PR. With regard to nested variables, I have following thoughts:
-
remove nested variable support in JSON format
JSON standard doesn't support nested variable. JSON is used primarily to transmit data between a server and web application. If I use a nested variable in JSON, I cannot use it in other place. For example, I cannot directly use a json config with nested variable in a project without phpdotenv package. And the nested variables in json file is a little confusing.
-
use built-in variable parsing in php format
Current nested variables in php config make it unexchangeable between differnt php projects. Because not all projects support this variable type. So I recommand using following way instead:
$baseDir="/var/webroot/project-root";
$cacheDir="${baseDir}/cache";
$tempDir="${baseDir}/tmp";
return array(
'BASE_DIR' => $baseDir,
'CACHE_DIR' => $cacheDir,
'TMP_DIR' => $tmpDir,
);
- make .env loader result as close as to shell parser result
In this way, the config files are more exchangeable.
from phpdotenv.
The new v2.0.0 release dropped the JSON and PHP loaders to standardize on shell-style only, which was the whole intent of this project in the first place. Please re-submit your changes based on the new v2.0.0 code, and we can review it for merge. Thanks!
from phpdotenv.
V2 finally released. I will send a pull request today.
from phpdotenv.
Related Issues (20)
- Unable to read the "/tmp/build_2f06b5cf/.env" environment file HOT 1
- auto_detect_line_endings is deprecated (PHP 8.1 + dotenv v2.6.9) HOT 1
- PHP version 7.1 is not supported now HOT 2
- Equals Symbol in last line of multiline variable causes issues. HOT 3
- Save to .env HOT 1
- How to loads many env file, but the extension is .txt HOT 1
- Fatal error: Uncaught Error: Class "Dotenv\Dotenv" not found in HOT 1
- Performance degradation HOT 3
- Question - are there any 'builtin' variables? HOT 3
- Add reader with support for secret files
- loading a .env file from outside the webspace seem to not work
- php 8.2 function getenv() not set HOT 1
- Please dont use $_SERVER HOT 1
- Load AWS system environments HOT 4
- symfony/dotenv Correlation HOT 1
- PHP version 7.4 HOT 1
- How does this help with php_value in .htaccess?
- Is there anyway to use sections created in the .env file? HOT 4
- Fatal error: Uncaught Error: Class "Dotenv\Dotenv" not found in HOT 2
- Can one use Heredoc syntax for multi-line strings? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpdotenv.