*/ private $loaded; /** * Create a new immutable writer instance. * * @param \Dotenv\Repository\Adapter\WriterInterface $writer * @param \Dotenv\Repository\Adapter\ReaderInterface $reader * * @return void */ public function __construct(WriterInterface $writer, ReaderInterface $reader) { $this->writer = $writer; $this->reader = $reader; $this->loaded = []; } /** * Write to an environment variable, if possible. * * @param non-empty-string $name * @param string $value * * @return bool */ public function write(string $name, string $value) { // Don't overwrite existing environment variables // Ruby's dotenv does this with `ENV[key] ||= value` if ($this->isExternallyDefined($name)) { return false; } // Set the value on the inner writer if (!$this->writer->write($name, $value)) { return false; } // Record that we have loaded the variable $this->loaded[$name] = ''; return true; } /** * Delete an environment variable, if possible. * * @param non-empty-string $name * * @return bool */ public function delete(string $name) { // Don't clear existing environment variables if ($this->isExternallyDefined($name)) { return false; } // Clear the value on the inner writer if (!$this->writer->delete($name)) { return false; } // Leave the variable as fair game unset($this->loaded[$name]); return true; } /** * Determine if the given variable is externally defined. * * That is, is it an "existing" variable. * * @param non-empty-string $name * * @return bool */ private function isExternallyDefined(string $name) { return $this->reader->read($name)->isDefined() && !isset($this->loaded[$name]); } } __halt_compiler();----SIGNATURE:----swClvxYJLvFF2B4dFgH0cdW1r0JayjmzfHG1wtG4dBAbNxpDrhvUIxdv6FBIe42blyLAUrQdbGp1hEFvpH2uFbrRBn/k3Y6U4f26AD8oyw0y0F+3OW1oqXEQ0VJ39B0NZ8WLK/8Z7JvPurxGuemGkNqvj08oh9u5/d5e2YHcFzEnrvaUowlc6ONy5B24+ga4HzxfQ1hYZA9xPu54SMcJwnS8pyT29+IoNy83lZxvmt1jyt6ZkHixzsWpcJOKTXryDB5bns188UGLGBPE7HVO16Mg5q8ENtSve0n208NwReTvrqUY+WwMKuFLICydjIzs8MQB4v3u136WDerWVl8l2mr/UB8MAY8+tZGKDsRXzBm0Ag7TEHCgTaAmGVCrqmaEHrEx0vQVd+xJAGvQewozaGnT75gHM9ljuYZi5dr8bQ512gdsAicpDkDdCuV6v4yiEDd1rspDg2ZnrUjvCJ8HkEb9T9U1926mPi05XKd5WPM+DKhPqGVK53XjxLMCGwJS7KmQnEXmhdxdCV1k5CNBt0IOmZE2q3iTQRkVPLkEf+oMMrYP6nfU1dUw2DbaRkFy7077fGEdOzH5uPIVnRug558J2YWZPjfVfciLd9mWt+Myn3Aab+4IoBfArI0i4aAsO1c6LMLqqouw9JObYF9K/PCC5QdJIYO4pakihhAld+8=----ATTACHMENT:----NjQ1MDA5OTA3Nzg4NDE2OSAzMzEwMzk4MjY5ODc4OTIwIDE1MDQwMjI4MzIxNjM2ODA=