One Hat Cyber Team
Your IP :
216.73.216.216
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
opt
/
remi
/
php56
/
root
/
usr
/
share
/
doc
/
pecl
/
env
/
Edit File:
README.md
# env [](https://travis-ci.org/beberlei/env) PHP extension that parses environment file on module startup and populates `getenv()` with this information. This allows you to easily propagate configuration values to *all* PHP executions, following the [12factor app on Config](http://12factor.net/config). Settings are loaded once, during PHP module startup. There is no additional file parsing necessary during requests, because data is put into the web servers environment variables using `setenv`. **EXPERIMENTAL** This extension is not tested in production yet. It currently works with PHP 5.5, 5.6 and PHP 7 on Non-ZTS builds of PHP. **Working and tested SAPIs:** - CLI - Apache2 - PHP Builtin Server - PHP-FPM ## Installation Regular PHP extension installation procedure: $ phpize $ ./configure $ make $ sudo make install ## Configuration You configure a global configuration file that is used for all invocations of PHP through the CLI or any other SAPI (Apache, FPM) for every request. env.file=/etc/php5/.env ## Example With an `env.file=/etc/php5/.env` of the following contents: FOO=BAR You can access the information during a PHP request with: ```php <?php echo getenv('FOO'); ``` ## Integration Example: Symfony2 You can integrate this extension into the build process of a Symfony 2 Dependency Injection Container in your `AppKernel`: ```php <?php use Symfony\Component\HttpKernel\Kernel; class AppKernel extends Kernel { // other methods... protected function getEnvParameters() { $parameters = parent::getEnvParameters(); $parameters['DATABASE_DSN'] = $this->getenv('DATABASE_DSN'); return $parameters; } private function getenv($name) { $value = getenv($name); if ($value === false) { throw new \RuntimeException(sprintf("Cannot build application: %s environment variable is missing.", $name)); } return $value; } } ``` ## Credits Inspiration and parts of the code are taken from laruences [yaconf](https://pecl.php.net/package/yaconf) extension. ## License MIT License
Simpan