mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-02 05:02:48 +08:00
33 lines
1.1 KiB
PHP
33 lines
1.1 KiB
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2006~2015 http://thinkphp.cn All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
|
// +----------------------------------------------------------------------
|
|
// | Author: liu21st <liu21st@gmail.com>
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace think;
|
|
|
|
// 内容解析类
|
|
class Parser {
|
|
|
|
static private $handler = [];
|
|
|
|
// 解析内容
|
|
static public function parse($content,$type){
|
|
if(!isset(self::$handler[$type])) {
|
|
$class = '\\Think\\Parser\\Driver\\'.strtolower($type);
|
|
self::$handler[$type] = new $class();
|
|
}
|
|
return self::$handler[$type]->parse($content);
|
|
}
|
|
|
|
// 调用驱动类的方法
|
|
static public function __callStatic($method, $params){
|
|
return self::parse($params[0],$method);
|
|
}
|
|
}
|