Compare commits

..

No commits in common. "master" and "V4.2.3" have entirely different histories.

9 changed files with 16 additions and 38 deletions

12
.github/FUNDING.yml vendored
View File

@ -1,12 +0,0 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: querylist # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

3
.gitignore vendored
View File

@ -1,5 +1,4 @@
/vendor/
.idea/
composer.lock
.DS_Store
*.cache
.DS_Store

View File

@ -29,7 +29,7 @@
- .....
## 环境要求
- PHP >= 7.1
- PHP >= 7.0
> 如果你的PHP版本还停留在PHP5或者不会使用Composer,你可以选择使用QueryList3,QueryList3支持php5.3以及手动安装。
QueryList3 文档:http://v3.querylist.cc
@ -306,4 +306,4 @@ $ql->curlMulti([
Jaeger <JaegerCode@gmail.com>
## Lisence
QueryList is licensed under the license of MIT. See the LICENSE for more details.
QueryList is licensed under the license of MIT. See the LICENSE for more details.

View File

@ -31,7 +31,7 @@ Through plug-ins you can easily implement things like:
- .....
## Requirements
- PHP >= 7.1
- PHP >= 7.0
## Installation
By Composer installation:
@ -301,4 +301,4 @@ Jaeger <JaegerCode@gmail.com>
If this library is useful for you, say thanks [buying me a beer :beer:](https://www.paypal.me/jaepay)!
## Lisence
QueryList is licensed under the license of MIT. See the LICENSE for more details.
QueryList is licensed under the license of MIT. See the LICENSE for more details.

View File

@ -6,9 +6,9 @@
"require": {
"PHP":">=7.1",
"jaeger/phpquery-single": "^1",
"tightenco/collect": "^5",
"jaeger/g-http": "^1.1",
"ext-dom": "*",
"tightenco/collect": ">5.0"
"ext-dom": "*"
},
"suggest":{

View File

@ -7,7 +7,6 @@
namespace QL;
use Closure;
use Tightenco\Collect\Support\Collection;
class Config
{
@ -21,8 +20,8 @@ class Config
*/
public function __construct()
{
$this->plugins = new Collection();
$this->binds = new Collection();
$this->plugins = collect();
$this->binds = collect();
}

View File

@ -9,7 +9,6 @@ namespace QL\Dom;
use phpDocumentor\Reflection\Types\Null_;
use phpQueryObject;
use Tightenco\Collect\Support\Collection;
/**
* Class Elements
@ -192,7 +191,7 @@ class Elements
*/
public function map($callback)
{
$collection = new Collection();
$collection = collect();
$this->elements->each(function ($dom) use (& $collection, $callback) {
$collection->push($callback(new self(pq($dom))));
});

View File

@ -125,8 +125,8 @@ class Query
*/
public function removeHead()
{
$html = preg_replace('/(<head>|<head\s+.+?>).+?<\/head>/is', '<head></head>', $this->html);
$html && $this->setHtml($html);
$html = preg_replace('/<head.+?>.+<\/head>/is', '<head></head>', $this->html);
$this->setHtml($html);
return $this->ql;
}
@ -147,7 +147,7 @@ class Query
{
if (is_callable($callback)) {
if (empty($this->range)) {
$data = new Collection($callback($data->all(), null));
$data = collect($callback($data->all(), null));
} else {
$data = $data->map($callback);
}
@ -178,7 +178,7 @@ class Query
}
}
return new Collection($data);
return collect($data);
}
protected function extractContent(phpQueryObject $pqObj, $ruleName, $rule)
@ -209,13 +209,7 @@ class Query
})->all();
break;
default:
if(preg_match('/attr\((.+)\)/', $rule['attr'], $arr)) {
$content = $pqObj->attr($arr[1]);
} elseif (preg_match('/attrs\((.+)\)/', $rule['attr'], $arr)) {
$content = (new Elements($pqObj))->attrs($arr[1])->all();
} else {
$content = $pqObj->attr($rule['attr']);
}
$content = $pqObj->attr($rule['attr']);
break;
}

View File

@ -14,7 +14,6 @@ use Closure;
use QL\Providers\HttpServiceProvider;
use QL\Providers\PluginServiceProvider;
use QL\Providers\SystemServiceProvider;
use Tightenco\Collect\Support\Collection;
class Kernel
{
@ -35,7 +34,7 @@ class Kernel
public function __construct(QueryList $ql)
{
$this->ql = $ql;
$this->binds = new Collection();
$this->binds = collect();
}
public function bootstrap()