diff --git a/QueryList.php b/QueryList.php index 7428e66..49b5300 100644 --- a/QueryList.php +++ b/QueryList.php @@ -1,4 +1,9 @@ setQuery(array('title'=>array('','text'),'url'=>array('a','href')),'#con_tw echo $hj->getData(); */ -namespace QueryList; + class QueryList { private $regArr; @@ -105,7 +110,7 @@ class QueryList $key = md5(serialize($args)); $className = array_shift($args); if(!class_exists($className)) { - throw new \Exception("no class {$className}"); + throw new Exception("no class {$className}"); } if(!isset(self::$instances[$key])) { $rc = new \ReflectionClass($className); @@ -173,8 +178,8 @@ class QueryList private function _getList() { - $this->inputEncoding && \phpQuery::$defaultCharset = $this->inputEncoding; - $document = \phpQuery::newDocumentHTML($this->html); + $this->inputEncoding && phpQuery::$defaultCharset = $this->inputEncoding; + $document = phpQuery::newDocumentHTML($this->html); $this->qpHtml = $document->htmlOuter(); if (!empty($this->regRange)) { $robj = pq($document)->find($this->regRange); @@ -210,7 +215,7 @@ class QueryList } else { while (list($key, $reg_value) = each($this->regArr)) { if($key=='callback')continue; - $document = \phpQuery::newDocumentHTML($this->html); + $document = phpQuery::newDocumentHTML($this->html); $tags = isset($reg_value[2])?$reg_value[2]:''; $lobj = pq($document)->find($reg_value[0]); $i = 0; @@ -241,7 +246,7 @@ class QueryList //编码转换 $this->data = $this->_arrayConvertEncoding($this->data, $this->outputEncoding, $this->htmlEncoding); } - \phpQuery::$documents = array(); + phpQuery::$documents = array(); } /** @@ -386,8 +391,8 @@ class QueryList foreach ($tags as $tag) { $tag_str .= $tag_str?','.$tag:$tag; } - \phpQuery::$defaultCharset = $this->inputEncoding?$this->inputEncoding:$this->htmlEncoding; - $doc = \phpQuery::newDocumentHTML($html); + phpQuery::$defaultCharset = $this->inputEncoding?$this->inputEncoding:$this->htmlEncoding; + $doc = phpQuery::newDocumentHTML($html); pq($doc)->find($tag_str)->remove(); $html = pq($doc)->htmlOuter(); $doc->unloadDocument(); diff --git a/composer.json b/composer.json index 815c9ac..8517664 100644 --- a/composer.json +++ b/composer.json @@ -4,9 +4,9 @@ "require": { "PHP":">=5.3.0", "jaeger/phpquery-single": "^0.9.5", - "jaeger/querylist-ext-aquery":"*", - "jaeger/curlmulti":"^1.0", - "jaeger/http":"^0.1" + "jaeger/querylist-ext-aquery":"dev-master", + "jaeger/curlmulti":"dev-master", + "jaeger/http":"dev-master" }, "license": "MIT", "authors": [ @@ -17,7 +17,7 @@ ], "autoload":{ "psr-4":{ - "QueryList\\":"" + "QL\\":"" } } }