diff --git a/Think/Cache.php b/Think/Cache.php index c220947a..a0ea0250 100644 --- a/Think/Cache.php +++ b/Think/Cache.php @@ -35,7 +35,7 @@ class Cache { } } - public static function __callStatic($method, $params){ + static public function __callStatic($method, $params){ return call_user_func_array(array(self::$handler, $method), $params); } diff --git a/Think/ConfigParser.php b/Think/ConfigParser.php deleted file mode 100644 index e2f3ad44..00000000 --- a/Think/ConfigParser.php +++ /dev/null @@ -1,26 +0,0 @@ - -// +---------------------------------------------------------------------- -// $Id$ - -namespace Think; -// 配置文件解析类 解析成php数组 -class ConfigParser { - public function __construct($content,$type){ - $class = '\Think\ConfigParser\Driver\\'.ucwords($type); - $parse = new $class(); - return $parse->parse($content); - } - - // 解析内容 - static public function parse($content,$type){ - return new static($content,$type); - } -} \ No newline at end of file diff --git a/Think/Db.php b/Think/Db.php index 2ee97235..f3561ee0 100644 --- a/Think/Db.php +++ b/Think/Db.php @@ -26,7 +26,7 @@ class Db { * @param boolean $lite 是否lite方式 * @return Object 返回数据库驱动类 */ - public static function instance($config=[],$lite=false) { + static public function instance($config=[],$lite=false) { $md5 = md5(serialize($config)); if(!isset(self::$instance[$md5])) { // 解析连接参数 支持数组和字符串 @@ -36,7 +36,7 @@ class Db { if(class_exists($class)) { self::$instance[$md5] = new $class($options); }else{ - Error::halt('_DB_TYPE_INVALID_:'.$options['dbms']); + E('_DB_TYPE_INVALID_:'.$options['dbms']); } } self::$_instance = self::$instance[$md5]; @@ -107,7 +107,7 @@ class Db { } // 调用驱动类的方法 - public static function __callStatic($method, $params){ + static public function __callStatic($method, $params){ return call_user_func_array(array(self::$_instance, $method), $params); } } \ No newline at end of file diff --git a/Think/Filter.php b/Think/Filter.php index 617bd64a..75c1ebaf 100644 --- a/Think/Filter.php +++ b/Think/Filter.php @@ -12,7 +12,7 @@ namespace Think; class Filter { //html标签设置 - public static $htmlTags = array( + static public $htmlTags = array( 'allow' => 'table|td|th|tr|i|b|u|strong|img|p|br|div|strong|em|ul|ol|li|dl|dd|dt|a', 'ban' => 'html|head|meta|link|base|basefont|body|bgsound|title|style|script|form|iframe|frame|frameset|applet|id|ilayer|layer|name|script|style|xml', ); diff --git a/Think/Image.php b/Think/Image.php index 6f682281..45f92c86 100644 --- a/Think/Image.php +++ b/Think/Image.php @@ -60,7 +60,7 @@ class Image { } // 调用驱动类的方法 - public static function __callStatic($method, $params){ + static public function __callStatic($method, $params){ if(empty(self::$im)) { self::init(); } diff --git a/Think/Log.php b/Think/Log.php index a79b3004..781d04b6 100644 --- a/Think/Log.php +++ b/Think/Log.php @@ -31,7 +31,7 @@ class Log { } // 调用驱动类的方法 - public static function __callStatic($method, $params){ + static public function __callStatic($method, $params){dump($params); return call_user_func_array(array(self::$handler, $method), $params); } diff --git a/Think/Parser.php b/Think/Parser.php index 09554a76..63e8bb32 100644 --- a/Think/Parser.php +++ b/Think/Parser.php @@ -14,15 +14,19 @@ namespace Think; // 内容解析类 class Parser { - public function __construct($content,$type){ - $class = '\Think\Parser\Driver\\'.ucwords($type); - $parse = new $class(); - return $parse->parse($content); - } - // 解析内容 static public function parse($content,$type){ - return new static($content,$type); + $class = '\Think\Parser\Driver\\'.ucwords($type); + if(class_exists($class)) { + $parse = new $class(); + return $parse->parse($content); + }else{ + E(L('_CLASS_NOT_EXIST_').': ' . $class); + } } + // 调用驱动类的方法 + static public function __callStatic($method, $params){ + return self::parse($params[0],$method); + } } \ No newline at end of file diff --git a/Think/Tag.php b/Think/Tag.php index 668ba09c..e635b9b6 100644 --- a/Think/Tag.php +++ b/Think/Tag.php @@ -20,7 +20,7 @@ class Tag { * @param array $behaviors 行为集 * @return void */ - public static function register($tag,$behaviors) { + static public function register($tag,$behaviors) { if(isset(self::$tags[$tag])) { self::$tags[$tag] = array_merge(self::$tags[$tag],$behaviors); }else{ @@ -34,7 +34,7 @@ class Tag { * @param mixed $behavior 行为名称 * @return void */ - public static function add($tag,$behavior,$range='') { + static public function add($tag,$behavior,$range='') { $range = $range?$range:ucwords(MODULE_NAME); self::$tags[$tag][] = [$behavior,$range]; } @@ -44,7 +44,7 @@ class Tag { * @param array $tags 标签行为 * @return void */ - public static function import($tags) { + static public function import($tags) { self::$tags = array_merge(self::$tags,$tags); } @@ -54,7 +54,7 @@ class Tag { * @param mixed $params 传入参数 * @return void */ - public static function listen($tag, &$params=NULL) { + static public function listen($tag, &$params=NULL) { Log::record($tag,'INFO'); Debug::remark($tag,'time'); if(isset(self::$tags[$tag])) { @@ -78,7 +78,7 @@ class Tag { * @param Mixed $params 传人的参数 * @return void */ - public static function exec($name, &$params=NULL,$range='') { + static public function exec($name, &$params=NULL,$range='') { $class = '\\'.$range.'\Behavior\\'.$name; if(class_exists($class)) { $behavior = new $class();