// +---------------------------------------------------------------------- namespace Think; class Log { static protected $handler = null; // 日志初始化 static public function init($config=[]){ if(!empty($config['type'])) { // 读取log驱动 $class = 'Think\\Log\\Driver\\'. ucwords(strtolower($config['type'])); // 检查驱动类 unset($config['type']); self::$handler = new $class($config); return self::$handler; } } // 调用驱动类的方法 static public function __callStatic($method, $params){ return call_user_func_array(array(self::$handler, $method), $params); } }