PROFILES(); $this->profiles = $profiles; A::update_nx($config, [ "schema" => $this->SCHEMA(), "dbs" => $this->DBS(), "msgs" => $this->MSGS(), "mails" => $this->MAILS(), "app" => $this->APP(), "user" => $this->USER(), ]); $this->config = $config; } function has(string $pkey, string $profile): bool { if ($this->profiles && !in_array($profile, $this->profiles)) return false; return A::phas_s($this->config, $pkey); } function get(string $pkey, string $profile) { if ($this->profiles && !in_array($profile, $this->profiles)) return null; return A::pget_s($this->config, $pkey); } function set(string $pkey, $value, string $profile): void { if ($this->profiles && !in_array($profile, $this->profiles)) { throw new ValueException("$profile: unauthorized profile"); } A::pset_s($this->config, $pkey, $value); } }