| Server IP : 68.178.172.28 / Your IP : 216.73.216.32 Web Server : Apache System : Linux 28.172.178.68.host.secureserver.net 4.18.0-553.89.1.el8_10.x86_64 #1 SMP Mon Dec 8 03:53:08 EST 2025 x86_64 User : kiskarnal ( 1003) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/kiskarnal/www/vendor/vlucas/phpdotenv/src/Repository/ |
Upload File : |
<?php
namespace Dotenv\Repository;
class AdapterRepository extends AbstractRepository
{
/**
* The set of readers to use.
*
* @var \Dotenv\Repository\Adapter\ReaderInterface[]
*/
protected $readers;
/**
* The set of writers to use.
*
* @var \Dotenv\Repository\Adapter\WriterInterface[]
*/
protected $writers;
/**
* Create a new adapter repository instance.
*
* @param \Dotenv\Repository\Adapter\ReaderInterface[] $readers
* @param \Dotenv\Repository\Adapter\WriterInterface[] $writers
* @param bool $immutable
*
* @return void
*/
public function __construct(array $readers, array $writers, $immutable)
{
$this->readers = $readers;
$this->writers = $writers;
parent::__construct($immutable);
}
/**
* Get an environment variable.
*
* We do this by querying our readers sequentially.
*
* @param string $name
*
* @return string|null
*/
protected function getInternal($name)
{
foreach ($this->readers as $reader) {
$result = $reader->get($name);
if ($result->isDefined()) {
return $result->get();
}
}
return null;
}
/**
* Set an environment variable.
*
* @param string $name
* @param string|null $value
*
* @return void
*/
protected function setInternal($name, $value = null)
{
foreach ($this->writers as $writers) {
$writers->set($name, $value);
}
}
/**
* Clear an environment variable.
*
* @param string $name
*
* @return void
*/
protected function clearInternal($name)
{
foreach ($this->writers as $writers) {
$writers->clear($name);
}
}
}