Path: blob/master/src/infrastructure/env/PhabricatorScopedEnv.php
12241 views
<?php12/**3* Scope guard to hold a temporary environment. See @{class:PhabricatorEnv} for4* instructions on use.5*6* @task internal Internals7* @task override Overriding Environment Configuration8*/9final class PhabricatorScopedEnv extends Phobject {1011private $key;12private $isPopped = false;1314/* -( Overriding Environment Configuration )------------------------------- */1516/**17* Override a configuration key in this scope, setting it to a new value.18*19* @param string Key to override.20* @param wild New value.21* @return this22*23* @task override24*/25public function overrideEnvConfig($key, $value) {26PhabricatorEnv::overrideTestEnvConfig(27$this->key,28$key,29$value);30return $this;31}323334/* -( Internals )---------------------------------------------------------- */353637/**38* @task internal39*/40public function __construct($stack_key) {41$this->key = $stack_key;42}434445/**46* Release the scoped environment.47*48* @return void49* @task internal50*/51public function __destruct() {52if (!$this->isPopped) {53PhabricatorEnv::popTestEnvironment($this->key);54$this->isPopped = true;55}56}5758}596061