protected function add($key, $value) { $public = false; if (substr($key, 0, 1) == '@') { $public = true; $key = substr($key, 1); } if (substr($key, 0, 5) == 'path.') { $value = Path::Create($value); } $this->values[$key] = new ConfigValue($value, $public); }
public function test_determines_if_directory_exists() { $this->assertTrue(Path::Create(static::TEST_DIR . '/pathtest/')->exists()); }
public function test_returns_url_if_path_in_web_root() { $this->assertEquals('/in/web/root', (string) Path::Create(static::WEB_ROOT . '/in/web/root')->webPath()); $this->assertEquals('/', (string) Path::Create(static::WEB_ROOT)->webPath()); $this->assertEquals('/file.ext', (string) Path::Create(static::WEB_ROOT . '/file.ext')->webPath()); }
protected static function Init() { if (static::$instance === null) { static::$instance = new ConfigManager(Path::Create($_SERVER['DOCUMENT_ROOT'])->append('../config/'), Environment::get()); } }