diff --git a/core/config.php b/core/config.php index 1b030d6f..a538da27 100644 --- a/core/config.php +++ b/core/config.php @@ -241,59 +241,6 @@ abstract class BaseConfig implements Config } -/** - * Class HardcodeConfig - * - * For testing, mostly. - */ -class HardcodeConfig extends BaseConfig -{ - public function __construct(array $dict) - { - $this->values = $dict; - } - - public function save(string $name=null): void - { - // static config is static - } -} - - -/** - * Class StaticConfig - * - * Loads the config list from a PHP file; the file should be in the format: - * - * - */ -class StaticConfig extends BaseConfig -{ - public function __construct(string $filename) - { - if (file_exists($filename)) { - $config = []; - require_once $filename; - if (!empty($config)) { - $this->values = $config; - } else { - throw new ScoreException("Config file '$filename' doesn't contain any config"); - } - } else { - throw new ScoreException("Config file '$filename' missing"); - } - } - - public function save(string $name=null): void - { - // static config is static - } -} - - /** * Class DatabaseConfig * @@ -389,16 +336,3 @@ class DatabaseConfig extends BaseConfig $cache->set("config", $this->values); } } - -/** - * Class MockConfig - */ -class MockConfig extends HardcodeConfig -{ - public function __construct(array $config=[]) - { - $config["db_version"] = "999"; - $config["anon_id"] = "0"; - parent::__construct($config); - } -}