config.php

来自「a short sketch about linux syntex lines.」· PHP 代码 · 共 21 行

PHP
21
字号
<?php
class Easy_Config{
	public function set($filename, $sec=false){
		$ext = substr(strrchr($filename, "."), 1);
		if ($ext == 'ini'){
			$this->cfg = new Easy_Config_Ini();
			$this->cfg->set($filename, $sec);
		}elseif ($ext == 'xml'){
			$this->cfg = new Easy_Config_Xml();
			$this->cfg->set($filename, $sec);
		}
	}
	public function __get($name=null){
		if (is_null($name)){
			return $this->cfg;
		}else{
			return $this->cfg->$name;
		}
	}
}
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?