├── .gitignore ├── README.md ├── composer.json ├── composer.lock ├── download.php ├── functions.php ├── index.php ├── mm.db ├── scanAll.php ├── scanNew.php ├── vendor ├── autoload.php ├── catfan │ └── medoo │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── composer.json │ │ └── src │ │ └── Medoo.php ├── composer │ ├── ClassLoader.php │ ├── LICENSE │ ├── autoload_classmap.php │ ├── autoload_files.php │ ├── autoload_namespaces.php │ ├── autoload_psr4.php │ ├── autoload_real.php │ ├── autoload_static.php │ └── installed.json ├── guzzlehttp │ ├── guzzle │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── UPGRADING.md │ │ ├── composer.json │ │ └── src │ │ │ ├── Client.php │ │ │ ├── ClientInterface.php │ │ │ ├── Cookie │ │ │ ├── CookieJar.php │ │ │ ├── CookieJarInterface.php │ │ │ ├── FileCookieJar.php │ │ │ ├── SessionCookieJar.php │ │ │ └── SetCookie.php │ │ │ ├── Exception │ │ │ ├── BadResponseException.php │ │ │ ├── ClientException.php │ │ │ ├── ConnectException.php │ │ │ ├── GuzzleException.php │ │ │ ├── RequestException.php │ │ │ ├── SeekException.php │ │ │ ├── ServerException.php │ │ │ ├── TooManyRedirectsException.php │ │ │ └── TransferException.php │ │ │ ├── Handler │ │ │ ├── CurlFactory.php │ │ │ ├── CurlFactoryInterface.php │ │ │ ├── CurlHandler.php │ │ │ ├── CurlMultiHandler.php │ │ │ ├── EasyHandle.php │ │ │ ├── MockHandler.php │ │ │ ├── Proxy.php │ │ │ └── StreamHandler.php │ │ │ ├── HandlerStack.php │ │ │ ├── MessageFormatter.php │ │ │ ├── Middleware.php │ │ │ ├── Pool.php │ │ │ ├── PrepareBodyMiddleware.php │ │ │ ├── RedirectMiddleware.php │ │ │ ├── RequestOptions.php │ │ │ ├── RetryMiddleware.php │ │ │ ├── TransferStats.php │ │ │ ├── UriTemplate.php │ │ │ ├── functions.php │ │ │ └── functions_include.php │ ├── promises │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── composer.json │ │ └── src │ │ │ ├── AggregateException.php │ │ │ ├── CancellationException.php │ │ │ ├── Coroutine.php │ │ │ ├── EachPromise.php │ │ │ ├── FulfilledPromise.php │ │ │ ├── Promise.php │ │ │ ├── PromiseInterface.php │ │ │ ├── PromisorInterface.php │ │ │ ├── RejectedPromise.php │ │ │ ├── RejectionException.php │ │ │ ├── TaskQueue.php │ │ │ ├── TaskQueueInterface.php │ │ │ ├── functions.php │ │ │ └── functions_include.php │ └── psr7 │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ └── src │ │ ├── AppendStream.php │ │ ├── BufferStream.php │ │ ├── CachingStream.php │ │ ├── DroppingStream.php │ │ ├── FnStream.php │ │ ├── InflateStream.php │ │ ├── LazyOpenStream.php │ │ ├── LimitStream.php │ │ ├── MessageTrait.php │ │ ├── MultipartStream.php │ │ ├── NoSeekStream.php │ │ ├── PumpStream.php │ │ ├── Request.php │ │ ├── Response.php │ │ ├── ServerRequest.php │ │ ├── Stream.php │ │ ├── StreamDecoratorTrait.php │ │ ├── StreamWrapper.php │ │ ├── UploadedFile.php │ │ ├── Uri.php │ │ ├── UriNormalizer.php │ │ ├── UriResolver.php │ │ ├── functions.php │ │ └── functions_include.php ├── jaeger │ ├── g-http │ │ ├── .gitignore │ │ ├── README.md │ │ ├── composer.json │ │ ├── composer.lock │ │ └── src │ │ │ └── GHttp.php │ ├── phpquery-single │ │ ├── README.md │ │ ├── composer.json │ │ └── phpQuery.php │ └── querylist │ │ ├── .gitignore │ │ ├── README-ZH.md │ │ ├── README.md │ │ ├── composer.json │ │ ├── logo.png │ │ └── src │ │ ├── Config.php │ │ ├── Contracts │ │ ├── PluginContract.php │ │ └── ServiceProviderContract.php │ │ ├── Dom │ │ ├── Dom.php │ │ ├── Elements.php │ │ └── Query.php │ │ ├── Exceptions │ │ └── ServiceNotFoundException.php │ │ ├── Kernel.php │ │ ├── Providers │ │ ├── EncodeServiceProvider.php │ │ ├── HttpServiceProvider.php │ │ ├── PluginServiceProvider.php │ │ └── SystemServiceProvider.php │ │ ├── QueryList.php │ │ └── Services │ │ ├── EncodeService.php │ │ ├── HttpService.php │ │ └── PluginService.php ├── psr │ └── http-message │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ └── src │ │ ├── MessageInterface.php │ │ ├── RequestInterface.php │ │ ├── ResponseInterface.php │ │ ├── ServerRequestInterface.php │ │ ├── StreamInterface.php │ │ ├── UploadedFileInterface.php │ │ └── UriInterface.php ├── symfony │ ├── polyfill-mbstring │ │ ├── LICENSE │ │ ├── Mbstring.php │ │ ├── README.md │ │ ├── Resources │ │ │ └── unidata │ │ │ │ ├── lowerCase.php │ │ │ │ └── upperCase.php │ │ ├── bootstrap.php │ │ └── composer.json │ ├── polyfill-php72 │ │ ├── LICENSE │ │ ├── Php72.php │ │ ├── README.md │ │ ├── bootstrap.php │ │ └── composer.json │ └── var-dumper │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── Caster │ │ ├── AmqpCaster.php │ │ ├── ArgsStub.php │ │ ├── Caster.php │ │ ├── ClassStub.php │ │ ├── ConstStub.php │ │ ├── CutArrayStub.php │ │ ├── CutStub.php │ │ ├── DOMCaster.php │ │ ├── DateCaster.php │ │ ├── DoctrineCaster.php │ │ ├── EnumStub.php │ │ ├── ExceptionCaster.php │ │ ├── FrameStub.php │ │ ├── LinkStub.php │ │ ├── PdoCaster.php │ │ ├── PgSqlCaster.php │ │ ├── RedisCaster.php │ │ ├── ReflectionCaster.php │ │ ├── ResourceCaster.php │ │ ├── SplCaster.php │ │ ├── StubCaster.php │ │ ├── SymfonyCaster.php │ │ ├── TraceStub.php │ │ ├── XmlReaderCaster.php │ │ └── XmlResourceCaster.php │ │ ├── Cloner │ │ ├── AbstractCloner.php │ │ ├── ClonerInterface.php │ │ ├── Cursor.php │ │ ├── Data.php │ │ ├── DumperInterface.php │ │ ├── Stub.php │ │ └── VarCloner.php │ │ ├── Dumper │ │ ├── AbstractDumper.php │ │ ├── CliDumper.php │ │ ├── DataDumperInterface.php │ │ └── HtmlDumper.php │ │ ├── Exception │ │ └── ThrowingCasterException.php │ │ ├── LICENSE │ │ ├── README.md │ │ ├── Resources │ │ └── functions │ │ │ └── dump.php │ │ ├── Test │ │ └── VarDumperTestTrait.php │ │ ├── Tests │ │ ├── Caster │ │ │ ├── CasterTest.php │ │ │ ├── DateCasterTest.php │ │ │ ├── ExceptionCasterTest.php │ │ │ ├── PdoCasterTest.php │ │ │ ├── RedisCasterTest.php │ │ │ ├── ReflectionCasterTest.php │ │ │ ├── SplCasterTest.php │ │ │ ├── StubCasterTest.php │ │ │ └── XmlReaderCasterTest.php │ │ ├── Cloner │ │ │ ├── DataTest.php │ │ │ └── VarClonerTest.php │ │ ├── Dumper │ │ │ ├── CliDumperTest.php │ │ │ └── HtmlDumperTest.php │ │ ├── Fixtures │ │ │ ├── FooInterface.php │ │ │ ├── GeneratorDemo.php │ │ │ ├── NotLoadableClass.php │ │ │ ├── Twig.php │ │ │ ├── dumb-var.php │ │ │ └── xml_reader.xml │ │ └── Test │ │ │ └── VarDumperTestTraitTest.php │ │ ├── VarDumper.php │ │ ├── composer.json │ │ └── phpunit.xml.dist └── tightenco │ └── collect │ ├── .gitignore │ ├── .travis.yml │ ├── collect-logo.png │ ├── composer.json │ ├── composer.lock │ ├── phpunit.xml │ ├── readme.md │ ├── src │ └── Collect │ │ ├── Contracts │ │ └── Support │ │ │ ├── Arrayable.php │ │ │ ├── Htmlable.php │ │ │ └── Jsonable.php │ │ └── Support │ │ ├── Arr.php │ │ ├── Collection.php │ │ ├── Debug │ │ ├── Dumper.php │ │ └── HtmlDumper.php │ │ ├── HigherOrderCollectionProxy.php │ │ ├── HtmlString.php │ │ ├── Traits │ │ └── Macroable.php │ │ ├── alias.php │ │ └── helpers.php │ ├── stubs │ ├── src │ │ └── Collect │ │ │ └── Support │ │ │ ├── alias.php │ │ │ └── helpers.php │ └── tests │ │ └── bootstrap.php │ ├── tests │ ├── Support │ │ ├── SupportArrTest.php │ │ ├── SupportCarbonTest.php │ │ ├── SupportCollectionTest.php │ │ └── SupportMacroableTest.php │ └── bootstrap.php │ └── upgrade.sh └── view.html /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | adminer-4.6.2.php 3 | adminer.php 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 美女图册 2 | 3 | 11万张随机妹子图一次看个够,可另存,可自动播放。营养快线在路上…… 4 | 5 | ## 详细介绍看这里 6 | 7 | [原创]11w+随机妹子图库 你的营养快线在路上 8 | 9 | ## 随机妹子图API 10 | 11 | 调用方式 12 | ``` 13 | 14 | ``` 15 | 16 | 17 | ## 扩展应用 18 | 19 | 利用上述API写了一个纯HTML的看图软件 20 | 21 | 地址:https://bak.yantuz.cn:8000/mmPic/view.html 22 | 23 | ## 关注我 24 | 25 | 26 | * 博客:[岩兔站](https://bak.yantuz.cn:000 "岩兔站-关注互联网折腾服务器分享码农的日常") 27 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "jaeger/querylist": "^4.0", 4 | "catfan/medoo": "^1.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /download.php: -------------------------------------------------------------------------------- 1 | '1', 12 | 'xiaohua' => '2', 13 | 'chemo' => '3', 14 | 'qipao' => '4', 15 | 'mingxing' => '5', 16 | 'xinggan' => '6' 17 | ); 18 | 19 | //根据URL获取html 20 | function readHtml($url){ 21 | $ql = QueryList::get($url,[],[ 22 | 'headers' => [ 23 | 'Referer' => $baseUrl 24 | ] 25 | ])->encoding("UTF-8"); 26 | return $ql->getHtml(); 27 | } 28 | 29 | //判断是否有下一页 30 | function hasNext($url){ 31 | $html = readHtml($url); 32 | //echo $html; 33 | $data = QueryList::html($html)->find('.page-en')->texts()->all(); 34 | return array_search('下一页', $data); 35 | } 36 | 37 | $db = new medoo([ 38 | 'database_type' => 'sqlite', 39 | 'database_file' => 'mm.db' 40 | ]); 41 | 42 | //获取列表,和总条数,并存入数据库 43 | function getList($url,$cat = ''){ 44 | //echo $url; 45 | $html = readHtml($url); 46 | $data = QueryList::html($html)->find('dd>a:lt(19)')->attrs('href'); 47 | //print_r ($data); 48 | 49 | foreach($data as $item){ 50 | //echo $item; 51 | //获取文章ID 52 | $itemId = substr($item,strrpos($item,'/')+1); 53 | $itemId = substr($itemId,0,strrpos($itemId,'.')); 54 | //echo $itemId; 55 | 56 | //获取文章总条数 57 | $itemHtml = readHtml($item); 58 | $itemData = QueryList::html($itemHtml)->find('.page-ch:first')->text(); 59 | $itemCount = str_replace('共','',$itemData); 60 | $itemCount = str_replace('页','',$itemCount); 61 | //echo $itemCount; 62 | 63 | //都有值 64 | if($itemId && $itemCount){ 65 | global $db; 66 | $dbResult=$db->select("items","id",["itemId" => $itemId]); 67 | 68 | //print_r($dbResult); 69 | 70 | //插入数据库 71 | if(!$dbResult){ 72 | $db->insert("items",[ 73 | 'cat' => $cat, 74 | "itemId" => $itemId, 75 | "count" => $itemCount 76 | ]); 77 | } 78 | } 79 | 80 | } 81 | } 82 | 83 | 84 | function listUrl($catName,$catId,$page=1){ 85 | global $baseUrl; 86 | $url = $baseUrl.$catName; 87 | if($page > 1){ 88 | $url = $url . '/list_'.$catId.'_'.$page.'.html'; 89 | } 90 | return $url; 91 | } 92 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | '1', 9 | 'xiaohua' => '2', 10 | 'chemo' => '3', 11 | 'qipao' => '4', 12 | 'mingxing' => '5', 13 | 'xinggan' => '6' 14 | ); 15 | $id = ''; 16 | $num = ''; 17 | $db = new medoo([ 18 | 'database_type' => 'sqlite', 19 | 'database_file' => 'mm.db' 20 | ]); 21 | 22 | //获取一张随机图片 23 | function getRandImg(){ 24 | global $db,$catArr,$id,$num; 25 | //连接数据库 26 | 27 | //判断参数 28 | $where=[]; 29 | $t = $_GET["t"]; 30 | if(array_key_exists($t,$catArr)){ 31 | $where = ["cat" => $catArr[$t]]; 32 | } 33 | 34 | //总数 35 | $count = $db->count('items',$where); 36 | 37 | //随机取一条 38 | $randRow = rand(0,$count); 39 | //echo $randRow; 40 | $where = array_merge($where,["LIMIT" => [$randRow, 1]]); 41 | $item = $db->select("items",['itemId','count'],$where); 42 | //print_r($items[0]); 43 | 44 | //随机的Id和张数 45 | $id = $item[0]['itemId']; 46 | $num = rand(1,$item[0]['count']); 47 | 48 | //存入Cookie 49 | setcookie('mmpic_id',$id); 50 | setcookie('mmpic_count',$item[0]['count']); 51 | setcookie('mmpic_num',$num); 52 | 53 | $url = "https://img1.hnllsy.com/pic/$id/$num.jpg"; 54 | //echo $url; 55 | return $url; 56 | } 57 | $id = $_GET['id']; 58 | $num = $_GET['num']; 59 | if($id && $num){ 60 | $url = "https://img1.hnllsy.com/pic/$id/$num.jpg"; 61 | //存入Cookie 62 | setcookie('mmpic_id',$id); 63 | setcookie('mmpic_num',$num); 64 | }else{ 65 | $url = getRandImg(); 66 | } 67 | //echo $url; 68 | $baseUrl = "https://www.mm131.net/"; 69 | function referfile($url,$refer='') { 70 | $opt=array('http'=>array('header'=>"Referer:$refer")); 71 | $context=stream_context_create($opt); 72 | $fileco=file_get_contents($url,false,$context); 73 | return $fileco; 74 | } 75 | $file = referfile($url,$baseUrl); 76 | if($_GET['down']=='1'){ 77 | header("content-disposition:attachment;filename=mm$id$num.jpg"); 78 | header('content-length:'. strlen($file)); 79 | }else{ 80 | header('Content-Type: image/jpeg'); 81 | } 82 | echo $file; 83 | 84 | //根据读取时间,判定是否要再读一次 85 | function upDay(){ 86 | global $db; 87 | $day = date("d"); 88 | $upDay = $db->select("option",["op_value"],["op_name"=>"upDay"]); 89 | if($upDay){ 90 | if($day == $upDay[0]['op_value']){ 91 | return true; 92 | }else{ 93 | $db->update('option',['op_value'=>$day],['op_name'=>'upDay']); 94 | return false; 95 | } 96 | }else{ 97 | $db->insert('option',['op_name'=>'upDay','value'=>$day]); 98 | return false; 99 | } 100 | } 101 | if($_GET['noUpdate'] == '1'){}else{ 102 | if(!upDay()){ 103 | require 'scanNew.php'; 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /mm.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yhf7952/mmPic/900f434ac84f2c608b8691fb2f0af5cfe0bfd83f/mm.db -------------------------------------------------------------------------------- /scanAll.php: -------------------------------------------------------------------------------- 1 | $v){ 6 | 7 | $page = 1; 8 | 9 | while(true){ 10 | //输出记录 11 | echo "scan:$k;page:$page\n"; 12 | $url = listUrl($k,$v,$page); 13 | if(hasNext($url)){ 14 | getList($url,$v); 15 | }else{ 16 | echo "Finish:$k \n"; 17 | break; 18 | } 19 | $page++; 20 | } 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /scanNew.php: -------------------------------------------------------------------------------- 1 | $v){ 5 | $url = listUrl($k,$v); 6 | getList($url,$v); 7 | } 8 | 9 | -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | 5 |

6 | Total Downloads 7 | Latest Stable Version 8 | License 9 |

10 | 11 | > The Lightest PHP database framework to accelerate development 12 | 13 | ## Features 14 | 15 | * **Lightweight** - Less than 100 KB, portable with only one file 16 | 17 | * **Easy** - Extremely easy to learn and use, friendly construction 18 | 19 | * **Powerful** - Supports various common and complex SQL queries, data mapping, and prevent SQL injection 20 | 21 | * **Compatible** - Supports all SQL databases, including MySQL, MSSQL, SQLite, MariaDB, PostgreSQL, Sybase, Oracle and more 22 | 23 | * **Friendly** - Works well with every PHP frameworks, like Laravel, Codeigniter, Yii, Slim, and framework which supports singleton extension or composer 24 | 25 | * **Free** - Under MIT license, you can use it anywhere whatever you want 26 | 27 | ## Requirement 28 | 29 | PHP 5.4+ and PDO extension installed 30 | 31 | ## Get Started 32 | 33 | ### Install via composer 34 | 35 | Add Medoo to composer.json configuration file. 36 | ``` 37 | $ composer require catfan/Medoo 38 | ``` 39 | 40 | And update the composer 41 | ``` 42 | $ composer update 43 | ``` 44 | 45 | ```php 46 | // If you installed via composer, just use this code to requrie autoloader on the top of your projects. 47 | require 'vendor/autoload.php'; 48 | 49 | // Using Medoo namespace 50 | use Medoo\Medoo; 51 | 52 | // Initialize 53 | $database = new Medoo([ 54 | 'database_type' => 'mysql', 55 | 'database_name' => 'name', 56 | 'server' => 'localhost', 57 | 'username' => 'your_username', 58 | 'password' => 'your_password' 59 | ]); 60 | 61 | // Enjoy 62 | $database->insert('account', [ 63 | 'user_name' => 'foo', 64 | 'email' => 'foo@bar.com' 65 | ]); 66 | 67 | $data = $database->select('account', [ 68 | 'user_name', 69 | 'email' 70 | ], [ 71 | 'user_id' => 50 72 | ]); 73 | 74 | echo json_encode($data); 75 | 76 | // [ 77 | // { 78 | // "user_name" : "foo", 79 | // "email" : "foo@bar.com", 80 | // } 81 | // ] 82 | ``` 83 | 84 | ## Contribution Guides 85 | 86 | For most of time, Medoo is using develop branch for adding feature and fixing bug, and the branch will be merged into master branch while releasing a public version. For contribution, submit your code to the develop branch, and start a pull request into it. 87 | 88 | On develop branch, each commits are started with `[fix]`, `[feature]` or `[update]` tag to indicate the change. 89 | 90 | Keep it simple and keep it clear. 91 | 92 | ## License 93 | 94 | Medoo is under the MIT license. 95 | 96 | ## Links 97 | 98 | * Official website: [https://medoo.in](https://medoo.in) 99 | 100 | * Documentation: [https://medoo.in/doc](https://medoo.in/doc) -------------------------------------------------------------------------------- /vendor/catfan/medoo/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "catfan/medoo", 3 | "type": "framework", 4 | "description": "The lightest PHP database framework to accelerate development", 5 | "keywords": ["database", "lightweight", "PHP framework", "SQL", "MySQL", "MSSQL", "SQLite", "PostgreSQL", "MariaDB", "Oracle"], 6 | "homepage": "https://medoo.in", 7 | "license": "MIT", 8 | "support": { 9 | "issues": "https://github.com/catfan/Medoo/issues", 10 | "source": "https://github.com/catfan/Medoo" 11 | }, 12 | "authors": [ 13 | {"name": "Angel Lai", "email": "angel@catfan.me"} 14 | ], 15 | "require": { 16 | "php": ">=5.4", 17 | "ext-pdo": "*" 18 | }, 19 | "suggest": { 20 | "ext-pdo_mysql": "For MySQL or MariaDB database", 21 | "ext-pdo_sqlsrv": "For MSSQL database", 22 | "ext-pdo_dblib": "For MSSQL or Sybase database on Linux/UNIX platform", 23 | "ext-pdo_oci": "For Oracle database", 24 | "ext-pdo_oci8": "For Oracle version 8 database", 25 | "ext-pdo_pqsql": "For PostgreSQL database", 26 | "ext-pdo_sqlite": "For SQLite database" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "Medoo\\": "/src" 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /vendor/composer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) Nils Adermann, Jordi Boggiano 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished 9 | to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /vendor/composer/autoload_classmap.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/jaeger/phpquery-single/phpQuery.php', 10 | 'CallbackBody' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php', 11 | 'CallbackParam' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php', 12 | 'CallbackParameterToReference' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php', 13 | 'CallbackReturnReference' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php', 14 | 'CallbackReturnValue' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php', 15 | 'DOMDocumentWrapper' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php', 16 | 'DOMEvent' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php', 17 | 'ICallbackNamed' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php', 18 | 'phpQuery' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php', 19 | 'phpQueryEvents' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php', 20 | 'phpQueryObject' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php', 21 | 'phpQueryPlugins' => $vendorDir . '/jaeger/phpquery-single/phpQuery.php', 22 | ); 23 | -------------------------------------------------------------------------------- /vendor/composer/autoload_files.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', 10 | '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', 11 | 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 12 | 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', 13 | '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', 14 | '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', 15 | 'fe62ba7e10580d903cc46d808b5961a4' => $vendorDir . '/tightenco/collect/src/Collect/Support/helpers.php', 16 | 'caf31cc6ec7cf2241cb6f12c226c3846' => $vendorDir . '/tightenco/collect/src/Collect/Support/alias.php', 17 | ); 18 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/tightenco/collect/src/Collect'), 10 | 'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'), 11 | 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 12 | 'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'), 13 | 'QL\\' => array($vendorDir . '/jaeger/querylist/src'), 14 | 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 15 | 'Medoo\\' => array($vendorDir . '/catfan/medoo/src'), 16 | 'Jaeger\\' => array($vendorDir . '/jaeger/g-http/src'), 17 | 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 18 | 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 19 | 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 20 | ); 21 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 27 | if ($useStaticLoader) { 28 | require_once __DIR__ . '/autoload_static.php'; 29 | 30 | call_user_func(\Composer\Autoload\ComposerStaticInit71719ba4e46577be5870f7aad0c8f533::getInitializer($loader)); 31 | } else { 32 | $map = require __DIR__ . '/autoload_namespaces.php'; 33 | foreach ($map as $namespace => $path) { 34 | $loader->set($namespace, $path); 35 | } 36 | 37 | $map = require __DIR__ . '/autoload_psr4.php'; 38 | foreach ($map as $namespace => $path) { 39 | $loader->setPsr4($namespace, $path); 40 | } 41 | 42 | $classMap = require __DIR__ . '/autoload_classmap.php'; 43 | if ($classMap) { 44 | $loader->addClassMap($classMap); 45 | } 46 | } 47 | 48 | $loader->register(true); 49 | 50 | if ($useStaticLoader) { 51 | $includeFiles = Composer\Autoload\ComposerStaticInit71719ba4e46577be5870f7aad0c8f533::$files; 52 | } else { 53 | $includeFiles = require __DIR__ . '/autoload_files.php'; 54 | } 55 | foreach ($includeFiles as $fileIdentifier => $file) { 56 | composerRequire71719ba4e46577be5870f7aad0c8f533($fileIdentifier, $file); 57 | } 58 | 59 | return $loader; 60 | } 61 | } 62 | 63 | function composerRequire71719ba4e46577be5870f7aad0c8f533($fileIdentifier, $file) 64 | { 65 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 66 | require $file; 67 | 68 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2016 Michael Dowling, https://github.com/mtdowling 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/README.md: -------------------------------------------------------------------------------- 1 | Guzzle, PHP HTTP client 2 | ======================= 3 | 4 | [![Build Status](https://travis-ci.org/guzzle/guzzle.svg?branch=master)](https://travis-ci.org/guzzle/guzzle) 5 | 6 | Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and 7 | trivial to integrate with web services. 8 | 9 | - Simple interface for building query strings, POST requests, streaming large 10 | uploads, streaming large downloads, using HTTP cookies, uploading JSON data, 11 | etc... 12 | - Can send both synchronous and asynchronous requests using the same interface. 13 | - Uses PSR-7 interfaces for requests, responses, and streams. This allows you 14 | to utilize other PSR-7 compatible libraries with Guzzle. 15 | - Abstracts away the underlying HTTP transport, allowing you to write 16 | environment and transport agnostic code; i.e., no hard dependency on cURL, 17 | PHP streams, sockets, or non-blocking event loops. 18 | - Middleware system allows you to augment and compose client behavior. 19 | 20 | ```php 21 | $client = new \GuzzleHttp\Client(); 22 | $res = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); 23 | echo $res->getStatusCode(); 24 | // 200 25 | echo $res->getHeaderLine('content-type'); 26 | // 'application/json; charset=utf8' 27 | echo $res->getBody(); 28 | // '{"id": 1420053, "name": "guzzle", ...}' 29 | 30 | // Send an asynchronous request. 31 | $request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); 32 | $promise = $client->sendAsync($request)->then(function ($response) { 33 | echo 'I completed! ' . $response->getBody(); 34 | }); 35 | $promise->wait(); 36 | ``` 37 | 38 | ## Help and docs 39 | 40 | - [Documentation](http://guzzlephp.org/) 41 | - [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle) 42 | - [Gitter](https://gitter.im/guzzle/guzzle) 43 | 44 | 45 | ## Installing Guzzle 46 | 47 | The recommended way to install Guzzle is through 48 | [Composer](http://getcomposer.org). 49 | 50 | ```bash 51 | # Install Composer 52 | curl -sS https://getcomposer.org/installer | php 53 | ``` 54 | 55 | Next, run the Composer command to install the latest stable version of Guzzle: 56 | 57 | ```bash 58 | php composer.phar require guzzlehttp/guzzle 59 | ``` 60 | 61 | After installing, you need to require Composer's autoloader: 62 | 63 | ```php 64 | require 'vendor/autoload.php'; 65 | ``` 66 | 67 | You can then later update Guzzle using composer: 68 | 69 | ```bash 70 | composer.phar update 71 | ``` 72 | 73 | 74 | ## Version Guidance 75 | 76 | | Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | 77 | |---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------| 78 | | 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 | 79 | | 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 | 80 | | 5.x | Maintained | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 | 81 | | 6.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 | 82 | 83 | [guzzle-3-repo]: https://github.com/guzzle/guzzle3 84 | [guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x 85 | [guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3 86 | [guzzle-6-repo]: https://github.com/guzzle/guzzle 87 | [guzzle-3-docs]: http://guzzle3.readthedocs.org/en/latest/ 88 | [guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/ 89 | [guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/ 90 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guzzlehttp/guzzle", 3 | "type": "library", 4 | "description": "Guzzle is a PHP HTTP client library", 5 | "keywords": ["framework", "http", "rest", "web service", "curl", "client", "HTTP client"], 6 | "homepage": "http://guzzlephp.org/", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Michael Dowling", 11 | "email": "mtdowling@gmail.com", 12 | "homepage": "https://github.com/mtdowling" 13 | } 14 | ], 15 | "require": { 16 | "php": ">=5.5", 17 | "guzzlehttp/psr7": "^1.4", 18 | "guzzlehttp/promises": "^1.0" 19 | }, 20 | "require-dev": { 21 | "ext-curl": "*", 22 | "phpunit/phpunit": "^4.0 || ^5.0", 23 | "psr/log": "^1.0" 24 | }, 25 | "autoload": { 26 | "files": ["src/functions_include.php"], 27 | "psr-4": { 28 | "GuzzleHttp\\": "src/" 29 | } 30 | }, 31 | "autoload-dev": { 32 | "psr-4": { 33 | "GuzzleHttp\\Tests\\": "tests/" 34 | } 35 | }, 36 | "suggest": { 37 | "psr/log": "Required for using the Log middleware" 38 | }, 39 | "extra": { 40 | "branch-alias": { 41 | "dev-master": "6.2-dev" 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/ClientInterface.php: -------------------------------------------------------------------------------- 1 | filename = $cookieFile; 27 | $this->storeSessionCookies = $storeSessionCookies; 28 | 29 | if (file_exists($cookieFile)) { 30 | $this->load($cookieFile); 31 | } 32 | } 33 | 34 | /** 35 | * Saves the file when shutting down 36 | */ 37 | public function __destruct() 38 | { 39 | $this->save($this->filename); 40 | } 41 | 42 | /** 43 | * Saves the cookies to a file. 44 | * 45 | * @param string $filename File to save 46 | * @throws \RuntimeException if the file cannot be found or created 47 | */ 48 | public function save($filename) 49 | { 50 | $json = []; 51 | foreach ($this as $cookie) { 52 | /** @var SetCookie $cookie */ 53 | if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { 54 | $json[] = $cookie->toArray(); 55 | } 56 | } 57 | 58 | $jsonStr = \GuzzleHttp\json_encode($json); 59 | if (false === file_put_contents($filename, $jsonStr)) { 60 | throw new \RuntimeException("Unable to save file {$filename}"); 61 | } 62 | } 63 | 64 | /** 65 | * Load cookies from a JSON formatted file. 66 | * 67 | * Old cookies are kept unless overwritten by newly loaded ones. 68 | * 69 | * @param string $filename Cookie file to load. 70 | * @throws \RuntimeException if the file cannot be loaded. 71 | */ 72 | public function load($filename) 73 | { 74 | $json = file_get_contents($filename); 75 | if (false === $json) { 76 | throw new \RuntimeException("Unable to load file {$filename}"); 77 | } elseif ($json === '') { 78 | return; 79 | } 80 | 81 | $data = \GuzzleHttp\json_decode($json, true); 82 | if (is_array($data)) { 83 | foreach (json_decode($json, true) as $cookie) { 84 | $this->setCookie(new SetCookie($cookie)); 85 | } 86 | } elseif (strlen($data)) { 87 | throw new \RuntimeException("Invalid cookie file: {$filename}"); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php: -------------------------------------------------------------------------------- 1 | sessionKey = $sessionKey; 26 | $this->storeSessionCookies = $storeSessionCookies; 27 | $this->load(); 28 | } 29 | 30 | /** 31 | * Saves cookies to session when shutting down 32 | */ 33 | public function __destruct() 34 | { 35 | $this->save(); 36 | } 37 | 38 | /** 39 | * Save cookies to the client session 40 | */ 41 | public function save() 42 | { 43 | $json = []; 44 | foreach ($this as $cookie) { 45 | /** @var SetCookie $cookie */ 46 | if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { 47 | $json[] = $cookie->toArray(); 48 | } 49 | } 50 | 51 | $_SESSION[$this->sessionKey] = json_encode($json); 52 | } 53 | 54 | /** 55 | * Load the contents of the client session into the data array 56 | */ 57 | protected function load() 58 | { 59 | if (!isset($_SESSION[$this->sessionKey])) { 60 | return; 61 | } 62 | $data = json_decode($_SESSION[$this->sessionKey], true); 63 | if (is_array($data)) { 64 | foreach ($data as $cookie) { 65 | $this->setCookie(new SetCookie($cookie)); 66 | } 67 | } elseif (strlen($data)) { 68 | throw new \RuntimeException("Invalid cookie data"); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php: -------------------------------------------------------------------------------- 1 | stream = $stream; 16 | $msg = $msg ?: 'Could not seek the stream to position ' . $pos; 17 | parent::__construct($msg); 18 | } 19 | 20 | /** 21 | * @return StreamInterface 22 | */ 23 | public function getStream() 24 | { 25 | return $this->stream; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Exception/ServerException.php: -------------------------------------------------------------------------------- 1 | factory = isset($options['handle_factory']) 29 | ? $options['handle_factory'] 30 | : new CurlFactory(3); 31 | } 32 | 33 | public function __invoke(RequestInterface $request, array $options) 34 | { 35 | if (isset($options['delay'])) { 36 | usleep($options['delay'] * 1000); 37 | } 38 | 39 | $easy = $this->factory->create($request, $options); 40 | curl_exec($easy->handle); 41 | $easy->errno = curl_errno($easy->handle); 42 | 43 | return CurlFactory::finish($this, $easy, $this->factory); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php: -------------------------------------------------------------------------------- 1 | headers)) { 48 | throw new \RuntimeException('No headers have been received'); 49 | } 50 | 51 | // HTTP-version SP status-code SP reason-phrase 52 | $startLine = explode(' ', array_shift($this->headers), 3); 53 | $headers = \GuzzleHttp\headers_from_lines($this->headers); 54 | $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); 55 | 56 | if (!empty($this->options['decode_content']) 57 | && isset($normalizedKeys['content-encoding']) 58 | ) { 59 | $headers['x-encoded-content-encoding'] 60 | = $headers[$normalizedKeys['content-encoding']]; 61 | unset($headers[$normalizedKeys['content-encoding']]); 62 | if (isset($normalizedKeys['content-length'])) { 63 | $headers['x-encoded-content-length'] 64 | = $headers[$normalizedKeys['content-length']]; 65 | 66 | $bodyLength = (int) $this->sink->getSize(); 67 | if ($bodyLength) { 68 | $headers[$normalizedKeys['content-length']] = $bodyLength; 69 | } else { 70 | unset($headers[$normalizedKeys['content-length']]); 71 | } 72 | } 73 | } 74 | 75 | // Attach a response to the easy handle with the parsed headers. 76 | $this->response = new Response( 77 | $startLine[1], 78 | $headers, 79 | $this->sink, 80 | substr($startLine[0], 5), 81 | isset($startLine[2]) ? (string) $startLine[2] : null 82 | ); 83 | } 84 | 85 | public function __get($name) 86 | { 87 | $msg = $name === 'handle' 88 | ? 'The EasyHandle has been released' 89 | : 'Invalid property: ' . $name; 90 | throw new \BadMethodCallException($msg); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Handler/Proxy.php: -------------------------------------------------------------------------------- 1 | nextHandler = $nextHandler; 23 | } 24 | 25 | /** 26 | * @param RequestInterface $request 27 | * @param array $options 28 | * 29 | * @return PromiseInterface 30 | */ 31 | public function __invoke(RequestInterface $request, array $options) 32 | { 33 | $fn = $this->nextHandler; 34 | 35 | // Don't do anything if the request has no body. 36 | if ($request->getBody()->getSize() === 0) { 37 | return $fn($request, $options); 38 | } 39 | 40 | $modify = []; 41 | 42 | // Add a default content-type if possible. 43 | if (!$request->hasHeader('Content-Type')) { 44 | if ($uri = $request->getBody()->getMetadata('uri')) { 45 | if ($type = Psr7\mimetype_from_filename($uri)) { 46 | $modify['set_headers']['Content-Type'] = $type; 47 | } 48 | } 49 | } 50 | 51 | // Add a default content-length or transfer-encoding header. 52 | if (!$request->hasHeader('Content-Length') 53 | && !$request->hasHeader('Transfer-Encoding') 54 | ) { 55 | $size = $request->getBody()->getSize(); 56 | if ($size !== null) { 57 | $modify['set_headers']['Content-Length'] = $size; 58 | } else { 59 | $modify['set_headers']['Transfer-Encoding'] = 'chunked'; 60 | } 61 | } 62 | 63 | // Add the expect header if needed. 64 | $this->addExpectHeader($request, $options, $modify); 65 | 66 | return $fn(Psr7\modify_request($request, $modify), $options); 67 | } 68 | 69 | private function addExpectHeader( 70 | RequestInterface $request, 71 | array $options, 72 | array &$modify 73 | ) { 74 | // Determine if the Expect header should be used 75 | if ($request->hasHeader('Expect')) { 76 | return; 77 | } 78 | 79 | $expect = isset($options['expect']) ? $options['expect'] : null; 80 | 81 | // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0 82 | if ($expect === false || $request->getProtocolVersion() < 1.1) { 83 | return; 84 | } 85 | 86 | // The expect header is unconditionally enabled 87 | if ($expect === true) { 88 | $modify['set_headers']['Expect'] = '100-Continue'; 89 | return; 90 | } 91 | 92 | // By default, send the expect header when the payload is > 1mb 93 | if ($expect === null) { 94 | $expect = 1048576; 95 | } 96 | 97 | // Always add if the body cannot be rewound, the size cannot be 98 | // determined, or the size is greater than the cutoff threshold 99 | $body = $request->getBody(); 100 | $size = $body->getSize(); 101 | 102 | if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { 103 | $modify['set_headers']['Expect'] = '100-Continue'; 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/RetryMiddleware.php: -------------------------------------------------------------------------------- 1 | decider = $decider; 38 | $this->nextHandler = $nextHandler; 39 | $this->delay = $delay ?: __CLASS__ . '::exponentialDelay'; 40 | } 41 | 42 | /** 43 | * Default exponential backoff delay function. 44 | * 45 | * @param $retries 46 | * 47 | * @return int 48 | */ 49 | public static function exponentialDelay($retries) 50 | { 51 | return (int) pow(2, $retries - 1); 52 | } 53 | 54 | /** 55 | * @param RequestInterface $request 56 | * @param array $options 57 | * 58 | * @return PromiseInterface 59 | */ 60 | public function __invoke(RequestInterface $request, array $options) 61 | { 62 | if (!isset($options['retries'])) { 63 | $options['retries'] = 0; 64 | } 65 | 66 | $fn = $this->nextHandler; 67 | return $fn($request, $options) 68 | ->then( 69 | $this->onFulfilled($request, $options), 70 | $this->onRejected($request, $options) 71 | ); 72 | } 73 | 74 | private function onFulfilled(RequestInterface $req, array $options) 75 | { 76 | return function ($value) use ($req, $options) { 77 | if (!call_user_func( 78 | $this->decider, 79 | $options['retries'], 80 | $req, 81 | $value, 82 | null 83 | )) { 84 | return $value; 85 | } 86 | return $this->doRetry($req, $options, $value); 87 | }; 88 | } 89 | 90 | private function onRejected(RequestInterface $req, array $options) 91 | { 92 | return function ($reason) use ($req, $options) { 93 | if (!call_user_func( 94 | $this->decider, 95 | $options['retries'], 96 | $req, 97 | null, 98 | $reason 99 | )) { 100 | return \GuzzleHttp\Promise\rejection_for($reason); 101 | } 102 | return $this->doRetry($req, $options); 103 | }; 104 | } 105 | 106 | private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null) 107 | { 108 | $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response); 109 | 110 | return $this($request, $options); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/TransferStats.php: -------------------------------------------------------------------------------- 1 | request = $request; 35 | $this->response = $response; 36 | $this->transferTime = $transferTime; 37 | $this->handlerErrorData = $handlerErrorData; 38 | $this->handlerStats = $handlerStats; 39 | } 40 | 41 | /** 42 | * @return RequestInterface 43 | */ 44 | public function getRequest() 45 | { 46 | return $this->request; 47 | } 48 | 49 | /** 50 | * Returns the response that was received (if any). 51 | * 52 | * @return ResponseInterface|null 53 | */ 54 | public function getResponse() 55 | { 56 | return $this->response; 57 | } 58 | 59 | /** 60 | * Returns true if a response was received. 61 | * 62 | * @return bool 63 | */ 64 | public function hasResponse() 65 | { 66 | return $this->response !== null; 67 | } 68 | 69 | /** 70 | * Gets handler specific error data. 71 | * 72 | * This might be an exception, a integer representing an error code, or 73 | * anything else. Relying on this value assumes that you know what handler 74 | * you are using. 75 | * 76 | * @return mixed 77 | */ 78 | public function getHandlerErrorData() 79 | { 80 | return $this->handlerErrorData; 81 | } 82 | 83 | /** 84 | * Get the effective URI the request was sent to. 85 | * 86 | * @return UriInterface 87 | */ 88 | public function getEffectiveUri() 89 | { 90 | return $this->request->getUri(); 91 | } 92 | 93 | /** 94 | * Get the estimated time the request was being transferred by the handler. 95 | * 96 | * @return float Time in seconds. 97 | */ 98 | public function getTransferTime() 99 | { 100 | return $this->transferTime; 101 | } 102 | 103 | /** 104 | * Gets an array of all of the handler specific transfer data. 105 | * 106 | * @return array 107 | */ 108 | public function getHandlerStats() 109 | { 110 | return $this->handlerStats; 111 | } 112 | 113 | /** 114 | * Get a specific handler statistic from the handler by name. 115 | * 116 | * @param string $stat Handler specific transfer stat to retrieve. 117 | * 118 | * @return mixed|null 119 | */ 120 | public function getHandlerStat($stat) 121 | { 122 | return isset($this->handlerStats[$stat]) 123 | ? $this->handlerStats[$stat] 124 | : null; 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/functions_include.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/Makefile: -------------------------------------------------------------------------------- 1 | all: clean test 2 | 3 | test: 4 | vendor/bin/phpunit 5 | 6 | coverage: 7 | vendor/bin/phpunit --coverage-html=artifacts/coverage 8 | 9 | view-coverage: 10 | open artifacts/coverage/index.html 11 | 12 | clean: 13 | rm -rf artifacts/* 14 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guzzlehttp/promises", 3 | "description": "Guzzle promises library", 4 | "keywords": ["promise"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Michael Dowling", 9 | "email": "mtdowling@gmail.com", 10 | "homepage": "https://github.com/mtdowling" 11 | } 12 | ], 13 | "require": { 14 | "php": ">=5.5.0" 15 | }, 16 | "require-dev": { 17 | "phpunit/phpunit": "^4.0" 18 | }, 19 | "autoload": { 20 | "psr-4": { 21 | "GuzzleHttp\\Promise\\": "src/" 22 | }, 23 | "files": ["src/functions_include.php"] 24 | }, 25 | "scripts": { 26 | "test": "vendor/bin/phpunit", 27 | "test-ci": "vendor/bin/phpunit --coverage-text" 28 | }, 29 | "extra": { 30 | "branch-alias": { 31 | "dev-master": "1.4-dev" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/AggregateException.php: -------------------------------------------------------------------------------- 1 | value = $value; 22 | } 23 | 24 | public function then( 25 | callable $onFulfilled = null, 26 | callable $onRejected = null 27 | ) { 28 | // Return itself if there is no onFulfilled function. 29 | if (!$onFulfilled) { 30 | return $this; 31 | } 32 | 33 | $queue = queue(); 34 | $p = new Promise([$queue, 'run']); 35 | $value = $this->value; 36 | $queue->add(static function () use ($p, $value, $onFulfilled) { 37 | if ($p->getState() === self::PENDING) { 38 | try { 39 | $p->resolve($onFulfilled($value)); 40 | } catch (\Throwable $e) { 41 | $p->reject($e); 42 | } catch (\Exception $e) { 43 | $p->reject($e); 44 | } 45 | } 46 | }); 47 | 48 | return $p; 49 | } 50 | 51 | public function otherwise(callable $onRejected) 52 | { 53 | return $this->then(null, $onRejected); 54 | } 55 | 56 | public function wait($unwrap = true, $defaultDelivery = null) 57 | { 58 | return $unwrap ? $this->value : null; 59 | } 60 | 61 | public function getState() 62 | { 63 | return self::FULFILLED; 64 | } 65 | 66 | public function resolve($value) 67 | { 68 | if ($value !== $this->value) { 69 | throw new \LogicException("Cannot resolve a fulfilled promise"); 70 | } 71 | } 72 | 73 | public function reject($reason) 74 | { 75 | throw new \LogicException("Cannot reject a fulfilled promise"); 76 | } 77 | 78 | public function cancel() 79 | { 80 | // pass 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/PromiseInterface.php: -------------------------------------------------------------------------------- 1 | reason = $reason; 22 | } 23 | 24 | public function then( 25 | callable $onFulfilled = null, 26 | callable $onRejected = null 27 | ) { 28 | // If there's no onRejected callback then just return self. 29 | if (!$onRejected) { 30 | return $this; 31 | } 32 | 33 | $queue = queue(); 34 | $reason = $this->reason; 35 | $p = new Promise([$queue, 'run']); 36 | $queue->add(static function () use ($p, $reason, $onRejected) { 37 | if ($p->getState() === self::PENDING) { 38 | try { 39 | // Return a resolved promise if onRejected does not throw. 40 | $p->resolve($onRejected($reason)); 41 | } catch (\Throwable $e) { 42 | // onRejected threw, so return a rejected promise. 43 | $p->reject($e); 44 | } catch (\Exception $e) { 45 | // onRejected threw, so return a rejected promise. 46 | $p->reject($e); 47 | } 48 | } 49 | }); 50 | 51 | return $p; 52 | } 53 | 54 | public function otherwise(callable $onRejected) 55 | { 56 | return $this->then(null, $onRejected); 57 | } 58 | 59 | public function wait($unwrap = true, $defaultDelivery = null) 60 | { 61 | if ($unwrap) { 62 | throw exception_for($this->reason); 63 | } 64 | } 65 | 66 | public function getState() 67 | { 68 | return self::REJECTED; 69 | } 70 | 71 | public function resolve($value) 72 | { 73 | throw new \LogicException("Cannot resolve a rejected promise"); 74 | } 75 | 76 | public function reject($reason) 77 | { 78 | if ($reason !== $this->reason) { 79 | throw new \LogicException("Cannot reject a rejected promise"); 80 | } 81 | } 82 | 83 | public function cancel() 84 | { 85 | // pass 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/RejectionException.php: -------------------------------------------------------------------------------- 1 | reason = $reason; 21 | 22 | $message = 'The promise was rejected'; 23 | 24 | if ($description) { 25 | $message .= ' with reason: ' . $description; 26 | } elseif (is_string($reason) 27 | || (is_object($reason) && method_exists($reason, '__toString')) 28 | ) { 29 | $message .= ' with reason: ' . $this->reason; 30 | } elseif ($reason instanceof \JsonSerializable) { 31 | $message .= ' with reason: ' 32 | . json_encode($this->reason, JSON_PRETTY_PRINT); 33 | } 34 | 35 | parent::__construct($message); 36 | } 37 | 38 | /** 39 | * Returns the rejection reason. 40 | * 41 | * @return mixed 42 | */ 43 | public function getReason() 44 | { 45 | return $this->reason; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/TaskQueue.php: -------------------------------------------------------------------------------- 1 | run(); 12 | */ 13 | class TaskQueue implements TaskQueueInterface 14 | { 15 | private $enableShutdown = true; 16 | private $queue = []; 17 | 18 | public function __construct($withShutdown = true) 19 | { 20 | if ($withShutdown) { 21 | register_shutdown_function(function () { 22 | if ($this->enableShutdown) { 23 | // Only run the tasks if an E_ERROR didn't occur. 24 | $err = error_get_last(); 25 | if (!$err || ($err['type'] ^ E_ERROR)) { 26 | $this->run(); 27 | } 28 | } 29 | }); 30 | } 31 | } 32 | 33 | public function isEmpty() 34 | { 35 | return !$this->queue; 36 | } 37 | 38 | public function add(callable $task) 39 | { 40 | $this->queue[] = $task; 41 | } 42 | 43 | public function run() 44 | { 45 | /** @var callable $task */ 46 | while ($task = array_shift($this->queue)) { 47 | $task(); 48 | } 49 | } 50 | 51 | /** 52 | * The task queue will be run and exhausted by default when the process 53 | * exits IFF the exit is not the result of a PHP E_ERROR error. 54 | * 55 | * You can disable running the automatic shutdown of the queue by calling 56 | * this function. If you disable the task queue shutdown process, then you 57 | * MUST either run the task queue (as a result of running your event loop 58 | * or manually using the run() method) or wait on each outstanding promise. 59 | * 60 | * Note: This shutdown will occur before any destructors are triggered. 61 | */ 62 | public function disableShutdown() 63 | { 64 | $this->enableShutdown = false; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/TaskQueueInterface.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guzzlehttp/psr7", 3 | "type": "library", 4 | "description": "PSR-7 message implementation that also provides common utility methods", 5 | "keywords": ["request", "response", "message", "stream", "http", "uri", "url"], 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "Michael Dowling", 10 | "email": "mtdowling@gmail.com", 11 | "homepage": "https://github.com/mtdowling" 12 | }, 13 | { 14 | "name": "Tobias Schultze", 15 | "homepage": "https://github.com/Tobion" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.4.0", 20 | "psr/http-message": "~1.0" 21 | }, 22 | "require-dev": { 23 | "phpunit/phpunit": "~4.0" 24 | }, 25 | "provide": { 26 | "psr/http-message-implementation": "1.0" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "GuzzleHttp\\Psr7\\": "src/" 31 | }, 32 | "files": ["src/functions_include.php"] 33 | }, 34 | "extra": { 35 | "branch-alias": { 36 | "dev-master": "1.4-dev" 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/BufferStream.php: -------------------------------------------------------------------------------- 1 | hwm = $hwm; 29 | } 30 | 31 | public function __toString() 32 | { 33 | return $this->getContents(); 34 | } 35 | 36 | public function getContents() 37 | { 38 | $buffer = $this->buffer; 39 | $this->buffer = ''; 40 | 41 | return $buffer; 42 | } 43 | 44 | public function close() 45 | { 46 | $this->buffer = ''; 47 | } 48 | 49 | public function detach() 50 | { 51 | $this->close(); 52 | } 53 | 54 | public function getSize() 55 | { 56 | return strlen($this->buffer); 57 | } 58 | 59 | public function isReadable() 60 | { 61 | return true; 62 | } 63 | 64 | public function isWritable() 65 | { 66 | return true; 67 | } 68 | 69 | public function isSeekable() 70 | { 71 | return false; 72 | } 73 | 74 | public function rewind() 75 | { 76 | $this->seek(0); 77 | } 78 | 79 | public function seek($offset, $whence = SEEK_SET) 80 | { 81 | throw new \RuntimeException('Cannot seek a BufferStream'); 82 | } 83 | 84 | public function eof() 85 | { 86 | return strlen($this->buffer) === 0; 87 | } 88 | 89 | public function tell() 90 | { 91 | throw new \RuntimeException('Cannot determine the position of a BufferStream'); 92 | } 93 | 94 | /** 95 | * Reads data from the buffer. 96 | */ 97 | public function read($length) 98 | { 99 | $currentLength = strlen($this->buffer); 100 | 101 | if ($length >= $currentLength) { 102 | // No need to slice the buffer because we don't have enough data. 103 | $result = $this->buffer; 104 | $this->buffer = ''; 105 | } else { 106 | // Slice up the result to provide a subset of the buffer. 107 | $result = substr($this->buffer, 0, $length); 108 | $this->buffer = substr($this->buffer, $length); 109 | } 110 | 111 | return $result; 112 | } 113 | 114 | /** 115 | * Writes data to the buffer. 116 | */ 117 | public function write($string) 118 | { 119 | $this->buffer .= $string; 120 | 121 | // TODO: What should happen here? 122 | if (strlen($this->buffer) >= $this->hwm) { 123 | return false; 124 | } 125 | 126 | return strlen($string); 127 | } 128 | 129 | public function getMetadata($key = null) 130 | { 131 | if ($key == 'hwm') { 132 | return $this->hwm; 133 | } 134 | 135 | return $key ? null : []; 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/DroppingStream.php: -------------------------------------------------------------------------------- 1 | stream = $stream; 23 | $this->maxLength = $maxLength; 24 | } 25 | 26 | public function write($string) 27 | { 28 | $diff = $this->maxLength - $this->stream->getSize(); 29 | 30 | // Begin returning 0 when the underlying stream is too large. 31 | if ($diff <= 0) { 32 | return 0; 33 | } 34 | 35 | // Write the stream or a subset of the stream if needed. 36 | if (strlen($string) < $diff) { 37 | return $this->stream->write($string); 38 | } 39 | 40 | return $this->stream->write(substr($string, 0, $diff)); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/InflateStream.php: -------------------------------------------------------------------------------- 1 | read(10); 25 | $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header); 26 | // Skip the header, that is 10 + length of filename + 1 (nil) bytes 27 | $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength); 28 | $resource = StreamWrapper::getResource($stream); 29 | stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ); 30 | $this->stream = new Stream($resource); 31 | } 32 | 33 | /** 34 | * @param StreamInterface $stream 35 | * @param $header 36 | * @return int 37 | */ 38 | private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) 39 | { 40 | $filename_header_length = 0; 41 | 42 | if (substr(bin2hex($header), 6, 2) === '08') { 43 | // we have a filename, read until nil 44 | $filename_header_length = 1; 45 | while ($stream->read(1) !== chr(0)) { 46 | $filename_header_length++; 47 | } 48 | } 49 | 50 | return $filename_header_length; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/LazyOpenStream.php: -------------------------------------------------------------------------------- 1 | filename = $filename; 27 | $this->mode = $mode; 28 | } 29 | 30 | /** 31 | * Creates the underlying stream lazily when required. 32 | * 33 | * @return StreamInterface 34 | */ 35 | protected function createStream() 36 | { 37 | return stream_for(try_fopen($this->filename, $this->mode)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/NoSeekStream.php: -------------------------------------------------------------------------------- 1 | isReadable()) { 33 | $mode = $stream->isWritable() ? 'r+' : 'r'; 34 | } elseif ($stream->isWritable()) { 35 | $mode = 'w'; 36 | } else { 37 | throw new \InvalidArgumentException('The stream must be readable, ' 38 | . 'writable, or both.'); 39 | } 40 | 41 | return fopen('guzzle://stream', $mode, null, stream_context_create([ 42 | 'guzzle' => ['stream' => $stream] 43 | ])); 44 | } 45 | 46 | /** 47 | * Registers the stream wrapper if needed 48 | */ 49 | public static function register() 50 | { 51 | if (!in_array('guzzle', stream_get_wrappers())) { 52 | stream_wrapper_register('guzzle', __CLASS__); 53 | } 54 | } 55 | 56 | public function stream_open($path, $mode, $options, &$opened_path) 57 | { 58 | $options = stream_context_get_options($this->context); 59 | 60 | if (!isset($options['guzzle']['stream'])) { 61 | return false; 62 | } 63 | 64 | $this->mode = $mode; 65 | $this->stream = $options['guzzle']['stream']; 66 | 67 | return true; 68 | } 69 | 70 | public function stream_read($count) 71 | { 72 | return $this->stream->read($count); 73 | } 74 | 75 | public function stream_write($data) 76 | { 77 | return (int) $this->stream->write($data); 78 | } 79 | 80 | public function stream_tell() 81 | { 82 | return $this->stream->tell(); 83 | } 84 | 85 | public function stream_eof() 86 | { 87 | return $this->stream->eof(); 88 | } 89 | 90 | public function stream_seek($offset, $whence) 91 | { 92 | $this->stream->seek($offset, $whence); 93 | 94 | return true; 95 | } 96 | 97 | public function stream_stat() 98 | { 99 | static $modeMap = [ 100 | 'r' => 33060, 101 | 'r+' => 33206, 102 | 'w' => 33188 103 | ]; 104 | 105 | return [ 106 | 'dev' => 0, 107 | 'ino' => 0, 108 | 'mode' => $modeMap[$this->mode], 109 | 'nlink' => 0, 110 | 'uid' => 0, 111 | 'gid' => 0, 112 | 'rdev' => 0, 113 | 'size' => $this->stream->getSize() ?: 0, 114 | 'atime' => 0, 115 | 'mtime' => 0, 116 | 'ctime' => 0, 117 | 'blksize' => 0, 118 | 'blocks' => 0 119 | ]; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/functions_include.php: -------------------------------------------------------------------------------- 1 | 'QueryList', 25 | 'wd2' => 'teststr' 26 | ]); 27 | 28 | //opt 29 | 30 | $rt = GHttp::get('https://www.baidu.com/s',[ 31 | 'wd' => 'QueryList' 32 | ],[ 33 | 'headers' => [ 34 | 'referer' => 'https://baidu.com', 35 | 'User-Agent' => 'Mozilla/5.0 (Windows NTChrome/58.0.3029.110 Safari/537.36', 36 | 'Cookie' => 'cookie xxx' 37 | ] 38 | ]); 39 | 40 | $rt = GHttp::getJson('https://xxxx.com/json'); 41 | 42 | ``` 43 | 44 | #### 2.post / postRaw / postJson 45 | ``` 46 | $rt = GHttp::post('https://www.posttestserver.com/post.php',[ 47 | 'name' => 'QueryList', 48 | 'password' => 'ql' 49 | ]); 50 | 51 | $rt = GHttp::post('https://www.posttestserver.com/post.php','name=QueryList&password=ql'); 52 | 53 | 54 | $rt = GHttp::postRaw('http://httpbin.org/post','raw data'); 55 | $rt = GHttp::postRaw('http://httpbin.org/post',['aa' => 11,'bb' => 22]); 56 | 57 | 58 | $rt = GHttp::postJson('http://httpbin.org/post',['aa' => 11,'bb' => 22]); 59 | $rt = GHttp::postJson('http://httpbin.org/post','aa=11&bb=22'); 60 | 61 | ``` 62 | #### 3.download 63 | 64 | ``` 65 | GHttp::download('http://sw.bos.baidu.com/setup.exe','./path/to/xx.exe'); 66 | ``` 67 | -------------------------------------------------------------------------------- /vendor/jaeger/g-http/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jaeger/g-http", 3 | "description": "Simple Http client base on GuzzleHttp", 4 | "license": "MIT", 5 | "authors": [ 6 | { 7 | "name": "Jaeger", 8 | "email": "JaegerCode@gmail.com" 9 | } 10 | ], 11 | "require": { 12 | "guzzlehttp/guzzle": "^6.2" 13 | }, 14 | "autoload":{ 15 | "psr-4":{ 16 | "Jaeger\\":"src" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/jaeger/phpquery-single/README.md: -------------------------------------------------------------------------------- 1 | # phpQuery-single 2 | phpQuery onefile composer.Continuous maintenance,Welcome PR. 3 | 4 | `QueryList` base on phpQuery: https://github.com/jae-jae/QueryList 5 | 6 | phpQuery单文件版本,持续维护,欢迎PR. 7 | > phpQuery项目主页:http://code.google.com/p/phpquery/ 8 | 9 | `QueryList`是基于phpQuery的采集工具: https://github.com/jae-jae/QueryList 10 | 11 | ## Composer Installation 12 | Packagist: https://packagist.org/packages/jaeger/phpquery-single 13 | ``` 14 | composer require jaeger/phpquery-single 15 | ``` 16 | 17 | ## Usage 18 | ```php 19 | $html = << 21 |
22 | QueryList官网 23 | 这是图片 24 | 这是图片2 25 |
26 | 其它的一些文本 27 | 28 | STR; 29 | 30 | $doc = phpQuery::newDocumentHTML($html); 31 | 32 | $src = $doc->find('.two img:eq(0)')->attr('src'); 33 | 34 | echo $src; 35 | // http://querylist.cc/1.jpg 36 | ``` -------------------------------------------------------------------------------- /vendor/jaeger/phpquery-single/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jaeger/phpquery-single", 3 | "description": "phpQuery单文件版本,是Querylist的依赖(http://querylist.cc/),phpQuery项目主页:http://code.google.com/p/phpquery/", 4 | "homepage": "http://code.google.com/p/phpquery/", 5 | "license": "MIT", 6 | "require": { 7 | "PHP":">=5.3.0" 8 | }, 9 | "authors": [ 10 | { 11 | "name": "Tobiasz Cudnik" 12 | ,"email": "tobiasz.cudnik@gmail.com" 13 | ,"homepage": "https://github.com/TobiaszCudnik" 14 | ,"role": "Developer" 15 | } 16 | ,{ 17 | "name": "Jaeger", 18 | "role": "Packager" 19 | } 20 | ], 21 | "autoload":{ 22 | "classmap":["phpQuery.php"] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/jaeger/querylist/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | .idea/ 3 | composer.lock 4 | .DS_Store -------------------------------------------------------------------------------- /vendor/jaeger/querylist/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jaeger/querylist", 3 | "description": "Simple, elegant, extensible PHP Web Scraper (crawler/spider),Use the css3 dom selector,Based on phpQuery! 简洁、优雅、可扩展的PHP采集工具(爬虫),基于phpQuery。", 4 | "keywords":["QueryList","phpQuery","spider"], 5 | "homepage": "http://querylist.cc", 6 | "require": { 7 | "PHP":">=7.0", 8 | "jaeger/phpquery-single": "^0.9", 9 | "tightenco/collect": "^5", 10 | "jaeger/g-http": "^1.1" 11 | }, 12 | "suggest":{ 13 | 14 | }, 15 | "license": "MIT", 16 | "authors": [ 17 | { 18 | "name": "Jaeger", 19 | "email": "JaegerCode@gmail.com" 20 | } 21 | ], 22 | "autoload":{ 23 | "psr-4":{ 24 | "QL\\":"src" 25 | } 26 | }, 27 | "require-dev": { 28 | "symfony/var-dumper": "^3.3" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/jaeger/querylist/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yhf7952/mmPic/900f434ac84f2c608b8691fb2f0af5cfe0bfd83f/vendor/jaeger/querylist/logo.png -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/Config.php: -------------------------------------------------------------------------------- 1 | 5 | * Date: 2017/9/22 6 | */ 7 | 8 | namespace QL; 9 | use Closure; 10 | 11 | class Config 12 | { 13 | protected static $instance = null; 14 | 15 | protected $plugins; 16 | protected $binds; 17 | 18 | /** 19 | * Config constructor. 20 | */ 21 | public function __construct() 22 | { 23 | $this->plugins = collect(); 24 | $this->binds = collect(); 25 | } 26 | 27 | 28 | /** 29 | * Get the Config instance 30 | * 31 | * @return null|Config 32 | */ 33 | public static function getInstance() 34 | { 35 | self::$instance || self::$instance = new self(); 36 | return self::$instance; 37 | } 38 | 39 | /** 40 | * Global installation plugin 41 | * 42 | * @param $plugins 43 | * @param array ...$opt 44 | * @return $this 45 | */ 46 | public function use($plugins,...$opt) 47 | { 48 | if(is_string($plugins)){ 49 | $this->plugins->push([$plugins,$opt]); 50 | }else{ 51 | $this->plugins = $this->plugins->merge($plugins); 52 | } 53 | return $this; 54 | } 55 | 56 | /** 57 | * Global binding custom method 58 | * 59 | * @param string $name 60 | * @param Closure $provider 61 | * @return $this 62 | */ 63 | public function bind(string $name, Closure $provider) 64 | { 65 | $this->binds[$name] = $provider; 66 | return $this; 67 | } 68 | 69 | public function bootstrap(QueryList $queryList) 70 | { 71 | $this->installPlugins($queryList); 72 | $this->installBind($queryList); 73 | } 74 | 75 | protected function installPlugins(QueryList $queryList) 76 | { 77 | $this->plugins->each(function($plugin) use($queryList){ 78 | if(is_string($plugin)){ 79 | $queryList->use($plugin); 80 | }else{ 81 | $queryList->use($plugin[0],...$plugin[1]); 82 | } 83 | }); 84 | } 85 | 86 | protected function installBind(QueryList $queryList) 87 | { 88 | $this->binds->each(function ($provider,$name) use($queryList){ 89 | $queryList->bind($name,$provider); 90 | }); 91 | } 92 | 93 | } -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/Contracts/PluginContract.php: -------------------------------------------------------------------------------- 1 | 5 | * Date: 2017/9/22 6 | */ 7 | 8 | namespace QL\Contracts; 9 | 10 | use QL\QueryList; 11 | 12 | interface PluginContract 13 | { 14 | public static function install(QueryList $queryList,...$opt); 15 | } -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/Contracts/ServiceProviderContract.php: -------------------------------------------------------------------------------- 1 | 5 | * Date: 2017/9/20 6 | */ 7 | 8 | namespace QL\Contracts; 9 | 10 | use QL\Kernel; 11 | 12 | interface ServiceProviderContract 13 | { 14 | public function register(Kernel $kernel); 15 | } -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/Dom/Dom.php: -------------------------------------------------------------------------------- 1 | 5 | * Date: 2017/9/19 6 | */ 7 | 8 | namespace QL\Dom; 9 | 10 | use phpQueryObject; 11 | 12 | class Dom 13 | { 14 | 15 | protected $document; 16 | 17 | /** 18 | * Dom constructor. 19 | */ 20 | public function __construct(phpQueryObject $document) 21 | { 22 | $this->document = $document; 23 | } 24 | 25 | public function find($selector) 26 | { 27 | $elements = $this->document->find($selector); 28 | return new Elements($elements); 29 | } 30 | } -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/Exceptions/ServiceNotFoundException.php: -------------------------------------------------------------------------------- 1 | 5 | * Date: 2017/9/21 6 | */ 7 | 8 | namespace QL\Exceptions; 9 | 10 | use Exception; 11 | 12 | class ServiceNotFoundException extends Exception 13 | { 14 | 15 | } -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/Kernel.php: -------------------------------------------------------------------------------- 1 | 5 | * Date: 2017/9/21 6 | */ 7 | 8 | namespace QL; 9 | 10 | use QL\Contracts\ServiceProviderContract; 11 | use QL\Exceptions\ServiceNotFoundException; 12 | use QL\Providers\EncodeServiceProvider; 13 | use Closure; 14 | use QL\Providers\HttpServiceProvider; 15 | use QL\Providers\PluginServiceProvider; 16 | use QL\Providers\SystemServiceProvider; 17 | 18 | class Kernel 19 | { 20 | protected $providers = [ 21 | SystemServiceProvider::class, 22 | HttpServiceProvider::class, 23 | EncodeServiceProvider::class, 24 | PluginServiceProvider::class 25 | ]; 26 | 27 | protected $binds; 28 | protected $ql; 29 | 30 | /** 31 | * Kernel constructor. 32 | * @param $ql 33 | */ 34 | public function __construct(QueryList $ql) 35 | { 36 | $this->ql = $ql; 37 | $this->binds = collect(); 38 | } 39 | 40 | public function bootstrap() 41 | { 42 | //注册服务提供者 43 | $this->registerProviders(); 44 | return $this; 45 | } 46 | 47 | public function registerProviders() 48 | { 49 | foreach ($this->providers as $provider) { 50 | $this->register(new $provider()); 51 | } 52 | } 53 | 54 | public function bind(string $name,Closure $provider) 55 | { 56 | $this->binds[$name] = $provider; 57 | } 58 | 59 | public function getService(string $name) 60 | { 61 | if(!$this->binds->offsetExists($name)){ 62 | throw new ServiceNotFoundException("Service: {$name} not found!"); 63 | } 64 | return $this->binds[$name]; 65 | } 66 | 67 | private function register(ServiceProviderContract $instance) 68 | { 69 | $instance->register($this); 70 | } 71 | 72 | 73 | } -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/Providers/EncodeServiceProvider.php: -------------------------------------------------------------------------------- 1 | 5 | * Date: 2017/9/20 6 | */ 7 | 8 | namespace QL\Providers; 9 | 10 | use QL\Contracts\ServiceProviderContract; 11 | use QL\Kernel; 12 | use QL\Services\EncodeService; 13 | 14 | class EncodeServiceProvider implements ServiceProviderContract 15 | { 16 | public function register(Kernel $kernel) 17 | { 18 | $kernel->bind('encoding',function (string $outputEncoding,string $inputEncoding = null){ 19 | return EncodeService::convert($this,$outputEncoding,$inputEncoding); 20 | }); 21 | } 22 | } -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/Providers/HttpServiceProvider.php: -------------------------------------------------------------------------------- 1 | 5 | * Date: 2017/9/22 6 | */ 7 | 8 | namespace QL\Providers; 9 | 10 | 11 | use QL\Contracts\ServiceProviderContract; 12 | use QL\Kernel; 13 | use QL\Services\HttpService; 14 | 15 | class HttpServiceProvider implements ServiceProviderContract 16 | { 17 | public function register(Kernel $kernel) 18 | { 19 | $kernel->bind('get',function (...$args){ 20 | return HttpService::get($this,...$args); 21 | }); 22 | 23 | $kernel->bind('post',function (...$args){ 24 | return HttpService::post($this,...$args); 25 | }); 26 | } 27 | } -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/Providers/PluginServiceProvider.php: -------------------------------------------------------------------------------- 1 | 5 | * Date: 2017/9/22 6 | */ 7 | 8 | namespace QL\Providers; 9 | 10 | use QL\Contracts\ServiceProviderContract; 11 | use QL\Kernel; 12 | use QL\Services\PluginService; 13 | 14 | class PluginServiceProvider implements ServiceProviderContract 15 | { 16 | public function register(Kernel $kernel) 17 | { 18 | $kernel->bind('use',function ($plugins,...$opt){ 19 | return PluginService::install($this,$plugins,...$opt); 20 | }); 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/Providers/SystemServiceProvider.php: -------------------------------------------------------------------------------- 1 | 5 | * Date: 2017/9/22 6 | */ 7 | 8 | namespace QL\Providers; 9 | 10 | use QL\Contracts\ServiceProviderContract; 11 | use QL\Kernel; 12 | 13 | class SystemServiceProvider implements ServiceProviderContract 14 | { 15 | public function register(Kernel $kernel) 16 | { 17 | $kernel->bind('html',function (...$args){ 18 | $this->setHtml(...$args); 19 | return $this; 20 | }); 21 | 22 | } 23 | } -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/QueryList.php: -------------------------------------------------------------------------------- 1 | query = new Query($this); 51 | $this->kernel = (new Kernel($this))->bootstrap(); 52 | Config::getInstance()->bootstrap($this); 53 | } 54 | 55 | public function __call($name, $arguments) 56 | { 57 | if(method_exists($this->query,$name)){ 58 | $result = $this->query->$name(...$arguments); 59 | }else{ 60 | $result = $this->kernel->getService($name)->call($this,...$arguments); 61 | } 62 | return $result; 63 | } 64 | 65 | public static function __callStatic($name, $arguments) 66 | { 67 | $instance = self::getInstance(); 68 | return $instance->$name(...$arguments); 69 | } 70 | 71 | public function __destruct() 72 | { 73 | $this->destruct(); 74 | } 75 | 76 | /** 77 | * Get the QueryList single instance 78 | * 79 | * @return QueryList 80 | */ 81 | public static function getInstance() 82 | { 83 | self::$instance || self::$instance = new self(); 84 | return self::$instance; 85 | } 86 | 87 | /** 88 | * Get the Config instance 89 | * @return null|Config 90 | */ 91 | public static function config() 92 | { 93 | return Config::getInstance(); 94 | } 95 | 96 | /** 97 | * Destruction of resources 98 | */ 99 | public function destruct() 100 | { 101 | phpQuery::$documents = []; 102 | } 103 | 104 | /** 105 | * Bind a custom method to the QueryList object 106 | * 107 | * @param string $name Invoking the name 108 | * @param Closure $provide Called method 109 | * @return $this 110 | */ 111 | public function bind(string $name,Closure $provide) 112 | { 113 | $this->kernel->bind($name,$provide); 114 | return $this; 115 | } 116 | 117 | } -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/Services/EncodeService.php: -------------------------------------------------------------------------------- 1 | 5 | * Date: 2017/9/20 6 | * 编码转换服务 7 | */ 8 | 9 | namespace QL\Services; 10 | 11 | use QL\QueryList; 12 | 13 | class EncodeService 14 | { 15 | public static function convert(QueryList $ql,string $outputEncoding,string $inputEncoding = null) 16 | { 17 | $html = $ql->getHtml(); 18 | $inputEncoding || $inputEncoding = self::detect($html); 19 | $html = iconv($inputEncoding,$outputEncoding.'//IGNORE',$html); 20 | $ql->setHtml($html); 21 | return $ql; 22 | } 23 | 24 | /** 25 | * Attempts to detect the encoding 26 | * @param $string 27 | * @return bool|false|mixed|string 28 | */ 29 | public static function detect($string) 30 | { 31 | $charset=mb_detect_encoding($string, array('ASCII', 'GB2312', 'GBK', 'UTF-8'),true); 32 | if(strtolower($charset)=='cp936') 33 | $charset='GBK'; 34 | return $charset; 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/Services/HttpService.php: -------------------------------------------------------------------------------- 1 | 5 | * Date: 2017/9/22 6 | */ 7 | 8 | namespace QL\Services; 9 | 10 | use GuzzleHttp\Cookie\CookieJar; 11 | use Jaeger\GHttp; 12 | use QL\QueryList; 13 | 14 | class HttpService 15 | { 16 | protected static $cookieJar = null; 17 | 18 | public static function getCookieJar() 19 | { 20 | if(self::$cookieJar == null) 21 | { 22 | self::$cookieJar = new CookieJar(); 23 | } 24 | return self::$cookieJar; 25 | } 26 | 27 | public static function get(QueryList $ql,$url,$args = null,$otherArgs = []) 28 | { 29 | $otherArgs = array_merge([ 30 | 'cookies' => self::getCookieJar(), 31 | 'verify' => false 32 | ],$otherArgs); 33 | $html = GHttp::get($url,$args,$otherArgs); 34 | $ql->setHtml($html); 35 | return $ql; 36 | } 37 | 38 | public static function post(QueryList $ql,$url,$args = null,$otherArgs = []) 39 | { 40 | $otherArgs = array_merge([ 41 | 'cookies' => self::getCookieJar(), 42 | 'verify' => false 43 | ],$otherArgs); 44 | $html = GHttp::post($url,$args,$otherArgs); 45 | $ql->setHtml($html); 46 | return $ql; 47 | } 48 | } -------------------------------------------------------------------------------- /vendor/jaeger/querylist/src/Services/PluginService.php: -------------------------------------------------------------------------------- 1 | 5 | * Date: 2017/9/22 6 | */ 7 | 8 | namespace QL\Services; 9 | 10 | use QL\QueryList; 11 | 12 | class PluginService 13 | { 14 | public static function install(QueryList $queryList, $plugins, ...$opt) 15 | { 16 | if(is_array($plugins)) 17 | { 18 | foreach ($plugins as $plugin) { 19 | $plugin::install($queryList); 20 | } 21 | }else{ 22 | $plugins::install($queryList,...$opt); 23 | } 24 | return $queryList; 25 | } 26 | } -------------------------------------------------------------------------------- /vendor/psr/http-message/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file, in reverse chronological order by release. 4 | 5 | ## 1.0.1 - 2016-08-06 6 | 7 | ### Added 8 | 9 | - Nothing. 10 | 11 | ### Deprecated 12 | 13 | - Nothing. 14 | 15 | ### Removed 16 | 17 | - Nothing. 18 | 19 | ### Fixed 20 | 21 | - Updated all `@return self` annotation references in interfaces to use 22 | `@return static`, which more closelly follows the semantics of the 23 | specification. 24 | - Updated the `MessageInterface::getHeaders()` return annotation to use the 25 | value `string[][]`, indicating the format is a nested array of strings. 26 | - Updated the `@link` annotation for `RequestInterface::withRequestTarget()` 27 | to point to the correct section of RFC 7230. 28 | - Updated the `ServerRequestInterface::withUploadedFiles()` parameter annotation 29 | to add the parameter name (`$uploadedFiles`). 30 | - Updated a `@throws` annotation for the `UploadedFileInterface::moveTo()` 31 | method to correctly reference the method parameter (it was referencing an 32 | incorrect parameter name previously). 33 | 34 | ## 1.0.0 - 2016-05-18 35 | 36 | Initial stable release; reflects accepted PSR-7 specification. 37 | -------------------------------------------------------------------------------- /vendor/psr/http-message/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 PHP Framework Interoperability Group 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/psr/http-message/README.md: -------------------------------------------------------------------------------- 1 | PSR Http Message 2 | ================ 3 | 4 | This repository holds all interfaces/classes/traits related to 5 | [PSR-7](http://www.php-fig.org/psr/psr-7/). 6 | 7 | Note that this is not a HTTP message implementation of its own. It is merely an 8 | interface that describes a HTTP message. See the specification for more details. 9 | 10 | Usage 11 | ----- 12 | 13 | We'll certainly need some stuff in here. -------------------------------------------------------------------------------- /vendor/psr/http-message/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "psr/http-message", 3 | "description": "Common interface for HTTP messages", 4 | "keywords": ["psr", "psr-7", "http", "http-message", "request", "response"], 5 | "homepage": "https://github.com/php-fig/http-message", 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "PHP-FIG", 10 | "homepage": "http://www.php-fig.org/" 11 | } 12 | ], 13 | "require": { 14 | "php": ">=5.3.0" 15 | }, 16 | "autoload": { 17 | "psr-4": { 18 | "Psr\\Http\\Message\\": "src/" 19 | } 20 | }, 21 | "extra": { 22 | "branch-alias": { 23 | "dev-master": "1.0.x-dev" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/psr/http-message/src/ResponseInterface.php: -------------------------------------------------------------------------------- 1 | =5.3.3" 20 | }, 21 | "autoload": { 22 | "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, 23 | "files": [ "bootstrap.php" ] 24 | }, 25 | "suggest": { 26 | "ext-mbstring": "For best performance" 27 | }, 28 | "minimum-stability": "dev", 29 | "extra": { 30 | "branch-alias": { 31 | "dev-master": "1.7-dev" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php72/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-2018 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php72/README.md: -------------------------------------------------------------------------------- 1 | Symfony Polyfill / Php72 2 | ======================== 3 | 4 | This component provides functions added to PHP 7.2 core: 5 | 6 | - [`spl_object_id`](https://php.net/spl_object_id) 7 | - [`stream_isatty`](https://php.net/stream_isatty) 8 | 9 | On Windows only: 10 | 11 | - [`sapi_windows_vt100_support`](https://php.net/sapi_windows_vt100_support) 12 | 13 | Moved to core since 7.2 (was in the optional XML extension earlier): 14 | 15 | - [`utf8_encode`](https://php.net/utf8_encode) 16 | - [`utf8_decode`](https://php.net/utf8_decode) 17 | 18 | Also, it provides a constant added to PHP 7.2: 19 | - [`PHP_OS_FAMILY`](http://php.net/manual/en/reserved.constants.php#constant.php-os-family) 20 | 21 | More information can be found in the 22 | [main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). 23 | 24 | License 25 | ======= 26 | 27 | This library is released under the [MIT license](LICENSE). 28 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php72/bootstrap.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Symfony\Polyfill\Php72 as p; 13 | 14 | if (PHP_VERSION_ID < 70200) { 15 | if ('\\' === DIRECTORY_SEPARATOR && !function_exists('sapi_windows_vt100_support')) { 16 | function sapi_windows_vt100_support($stream, $enable = null) { return p\Php72::sapi_windows_vt100_support($stream, $enable); } 17 | } 18 | if (!function_exists('stream_isatty')) { 19 | function stream_isatty($stream) { return p\Php72::stream_isatty($stream); } 20 | } 21 | if (!function_exists('utf8_encode')) { 22 | function utf8_encode($s) { return p\Php72::utf8_encode($s); } 23 | function utf8_decode($s) { return p\Php72::utf8_decode($s); } 24 | } 25 | if (!function_exists('spl_object_id')) { 26 | function spl_object_id($s) { return p\Php72::spl_object_id($s); } 27 | } 28 | if (!defined('PHP_OS_FAMILY')) { 29 | define('PHP_OS_FAMILY', p\Php72::php_os_family()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php72/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/polyfill-php72", 3 | "type": "library", 4 | "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", 5 | "keywords": ["polyfill", "shim", "compatibility", "portable"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Nicolas Grekas", 11 | "email": "p@tchwork.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.3.3" 20 | }, 21 | "autoload": { 22 | "psr-4": { "Symfony\\Polyfill\\Php72\\": "" }, 23 | "files": [ "bootstrap.php" ] 24 | }, 25 | "minimum-stability": "dev", 26 | "extra": { 27 | "branch-alias": { 28 | "dev-master": "1.7-dev" 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | phpunit.xml 3 | vendor/ 4 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | CHANGELOG 2 | ========= 3 | 4 | 4.0.0 5 | ----- 6 | 7 | * support for passing `\ReflectionClass` instances to the `Caster::castObject()` 8 | method has been dropped, pass class names as strings instead 9 | * the `Data::getRawData()` method has been removed 10 | * the `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$context = null` 11 | argument and moves `$message = ''` argument at 4th position. 12 | * the `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$context = null` 13 | argument and moves `$message = ''` argument at 4th position. 14 | 15 | 3.4.0 16 | ----- 17 | 18 | * added `AbstractCloner::setMinDepth()` function to ensure minimum tree depth 19 | * deprecated `MongoCaster` 20 | 21 | 2.7.0 22 | ----- 23 | 24 | * deprecated Cloner\Data::getLimitedClone(). Use withMaxDepth, withMaxItemsPerDepth or withRefHandles instead. 25 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ArgsStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents a list of function arguments. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class ArgsStub extends EnumStub 22 | { 23 | private static $parameters = array(); 24 | 25 | public function __construct(array $args, string $function, ?string $class) 26 | { 27 | list($variadic, $params) = self::getParameters($function, $class); 28 | 29 | $values = array(); 30 | foreach ($args as $k => $v) { 31 | $values[$k] = !is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v; 32 | } 33 | if (null === $params) { 34 | parent::__construct($values, false); 35 | 36 | return; 37 | } 38 | if (count($values) < count($params)) { 39 | $params = array_slice($params, 0, count($values)); 40 | } elseif (count($values) > count($params)) { 41 | $values[] = new EnumStub(array_splice($values, count($params)), false); 42 | $params[] = $variadic; 43 | } 44 | if (array('...') === $params) { 45 | $this->dumpKeys = false; 46 | $this->value = $values[0]->value; 47 | } else { 48 | $this->value = array_combine($params, $values); 49 | } 50 | } 51 | 52 | private static function getParameters($function, $class) 53 | { 54 | if (isset(self::$parameters[$k = $class.'::'.$function])) { 55 | return self::$parameters[$k]; 56 | } 57 | 58 | try { 59 | $r = null !== $class ? new \ReflectionMethod($class, $function) : new \ReflectionFunction($function); 60 | } catch (\ReflectionException $e) { 61 | return array(null, null); 62 | } 63 | 64 | $variadic = '...'; 65 | $params = array(); 66 | foreach ($r->getParameters() as $v) { 67 | $k = '$'.$v->name; 68 | if ($v->isPassedByReference()) { 69 | $k = '&'.$k; 70 | } 71 | if ($v->isVariadic()) { 72 | $variadic .= $k; 73 | } else { 74 | $params[] = $k; 75 | } 76 | } 77 | 78 | return self::$parameters[$k] = array($variadic, $params); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ClassStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | /** 15 | * Represents a PHP class identifier. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class ClassStub extends ConstStub 20 | { 21 | /** 22 | * @param string A PHP identifier, e.g. a class, method, interface, etc. name 23 | * @param callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier 24 | */ 25 | public function __construct(string $identifier, $callable = null) 26 | { 27 | $this->value = $identifier; 28 | 29 | if (0 < $i = strrpos($identifier, '\\')) { 30 | $this->attr['ellipsis'] = strlen($identifier) - $i; 31 | $this->attr['ellipsis-type'] = 'class'; 32 | $this->attr['ellipsis-tail'] = 1; 33 | } 34 | 35 | try { 36 | if (null !== $callable) { 37 | if ($callable instanceof \Closure) { 38 | $r = new \ReflectionFunction($callable); 39 | } elseif (is_object($callable)) { 40 | $r = array($callable, '__invoke'); 41 | } elseif (is_array($callable)) { 42 | $r = $callable; 43 | } elseif (false !== $i = strpos($callable, '::')) { 44 | $r = array(substr($callable, 0, $i), substr($callable, 2 + $i)); 45 | } else { 46 | $r = new \ReflectionFunction($callable); 47 | } 48 | } elseif (0 < $i = strpos($identifier, '::') ?: strpos($identifier, '->')) { 49 | $r = array(substr($identifier, 0, $i), substr($identifier, 2 + $i)); 50 | } else { 51 | $r = new \ReflectionClass($identifier); 52 | } 53 | 54 | if (is_array($r)) { 55 | try { 56 | $r = new \ReflectionMethod($r[0], $r[1]); 57 | } catch (\ReflectionException $e) { 58 | $r = new \ReflectionClass($r[0]); 59 | } 60 | } 61 | } catch (\ReflectionException $e) { 62 | return; 63 | } 64 | 65 | if ($f = $r->getFileName()) { 66 | $this->attr['file'] = $f; 67 | $this->attr['line'] = $r->getStartLine(); 68 | } 69 | } 70 | 71 | public static function wrapCallable($callable) 72 | { 73 | if (is_object($callable) || !is_callable($callable)) { 74 | return $callable; 75 | } 76 | 77 | if (!is_array($callable)) { 78 | $callable = new static($callable); 79 | } elseif (is_string($callable[0])) { 80 | $callable[0] = new static($callable[0]); 81 | } else { 82 | $callable[1] = new static($callable[1], $callable); 83 | } 84 | 85 | return $callable; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ConstStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents a PHP constant and its value. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class ConstStub extends Stub 22 | { 23 | public function __construct(string $name, $value) 24 | { 25 | $this->class = $name; 26 | $this->value = $value; 27 | } 28 | 29 | public function __toString() 30 | { 31 | return (string) $this->value; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/CutArrayStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | /** 15 | * Represents a cut array. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class CutArrayStub extends CutStub 20 | { 21 | public $preservedSubset; 22 | 23 | public function __construct(array $value, array $preservedKeys) 24 | { 25 | parent::__construct($value); 26 | 27 | $this->preservedSubset = array_intersect_key($value, array_flip($preservedKeys)); 28 | $this->cut -= count($this->preservedSubset); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/CutStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents the main properties of a PHP variable, pre-casted by a caster. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class CutStub extends Stub 22 | { 23 | public function __construct($value) 24 | { 25 | $this->value = $value; 26 | 27 | switch (gettype($value)) { 28 | case 'object': 29 | $this->type = self::TYPE_OBJECT; 30 | $this->class = get_class($value); 31 | $this->cut = -1; 32 | break; 33 | 34 | case 'array': 35 | $this->type = self::TYPE_ARRAY; 36 | $this->class = self::ARRAY_ASSOC; 37 | $this->cut = $this->value = count($value); 38 | break; 39 | 40 | case 'resource': 41 | case 'unknown type': 42 | case 'resource (closed)': 43 | $this->type = self::TYPE_RESOURCE; 44 | $this->handle = (int) $value; 45 | if ('Unknown' === $this->class = @get_resource_type($value)) { 46 | $this->class = 'Closed'; 47 | } 48 | $this->cut = -1; 49 | break; 50 | 51 | case 'string': 52 | $this->type = self::TYPE_STRING; 53 | $this->class = preg_match('//u', $value) ? self::STRING_UTF8 : self::STRING_BINARY; 54 | $this->cut = self::STRING_BINARY === $this->class ? strlen($value) : mb_strlen($value, 'UTF-8'); 55 | $this->value = ''; 56 | break; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/DoctrineCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Doctrine\Common\Proxy\Proxy as CommonProxy; 15 | use Doctrine\ORM\Proxy\Proxy as OrmProxy; 16 | use Doctrine\ORM\PersistentCollection; 17 | use Symfony\Component\VarDumper\Cloner\Stub; 18 | 19 | /** 20 | * Casts Doctrine related classes to array representation. 21 | * 22 | * @author Nicolas Grekas 23 | */ 24 | class DoctrineCaster 25 | { 26 | public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, $isNested) 27 | { 28 | foreach (array('__cloner__', '__initializer__') as $k) { 29 | if (array_key_exists($k, $a)) { 30 | unset($a[$k]); 31 | ++$stub->cut; 32 | } 33 | } 34 | 35 | return $a; 36 | } 37 | 38 | public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, $isNested) 39 | { 40 | foreach (array('_entityPersister', '_identifier') as $k) { 41 | if (array_key_exists($k = "\0Doctrine\\ORM\\Proxy\\Proxy\0".$k, $a)) { 42 | unset($a[$k]); 43 | ++$stub->cut; 44 | } 45 | } 46 | 47 | return $a; 48 | } 49 | 50 | public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, $isNested) 51 | { 52 | foreach (array('snapshot', 'association', 'typeClass') as $k) { 53 | if (array_key_exists($k = "\0Doctrine\\ORM\\PersistentCollection\0".$k, $a)) { 54 | $a[$k] = new CutStub($a[$k]); 55 | } 56 | } 57 | 58 | return $a; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/EnumStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents an enumeration of values. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class EnumStub extends Stub 22 | { 23 | public $dumpKeys = true; 24 | 25 | public function __construct(array $values, bool $dumpKeys = true) 26 | { 27 | $this->value = $values; 28 | $this->dumpKeys = $dumpKeys; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/FrameStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | /** 15 | * Represents a single backtrace frame as returned by debug_backtrace() or Exception->getTrace(). 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class FrameStub extends EnumStub 20 | { 21 | public $keepArgs; 22 | public $inTraceStub; 23 | 24 | public function __construct(array $frame, bool $keepArgs = true, bool $inTraceStub = false) 25 | { 26 | $this->value = $frame; 27 | $this->keepArgs = $keepArgs; 28 | $this->inTraceStub = $inTraceStub; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/RedisCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts Redis class from ext-redis to array representation. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class RedisCaster 22 | { 23 | private static $serializer = array( 24 | \Redis::SERIALIZER_NONE => 'NONE', 25 | \Redis::SERIALIZER_PHP => 'PHP', 26 | 2 => 'IGBINARY', // Optional Redis::SERIALIZER_IGBINARY 27 | ); 28 | 29 | public static function castRedis(\Redis $c, array $a, Stub $stub, $isNested) 30 | { 31 | $prefix = Caster::PREFIX_VIRTUAL; 32 | 33 | if (!$connected = $c->isConnected()) { 34 | return $a + array( 35 | $prefix.'isConnected' => $connected, 36 | ); 37 | } 38 | 39 | $ser = $c->getOption(\Redis::OPT_SERIALIZER); 40 | $retry = defined('Redis::OPT_SCAN') ? $c->getOption(\Redis::OPT_SCAN) : 0; 41 | 42 | return $a + array( 43 | $prefix.'isConnected' => $connected, 44 | $prefix.'host' => $c->getHost(), 45 | $prefix.'port' => $c->getPort(), 46 | $prefix.'auth' => $c->getAuth(), 47 | $prefix.'dbNum' => $c->getDbNum(), 48 | $prefix.'timeout' => $c->getTimeout(), 49 | $prefix.'persistentId' => $c->getPersistentID(), 50 | $prefix.'options' => new EnumStub(array( 51 | 'READ_TIMEOUT' => $c->getOption(\Redis::OPT_READ_TIMEOUT), 52 | 'SERIALIZER' => isset(self::$serializer[$ser]) ? new ConstStub(self::$serializer[$ser], $ser) : $ser, 53 | 'PREFIX' => $c->getOption(\Redis::OPT_PREFIX), 54 | 'SCAN' => new ConstStub($retry ? 'RETRY' : 'NORETRY', $retry), 55 | )), 56 | ); 57 | } 58 | 59 | public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, $isNested) 60 | { 61 | $prefix = Caster::PREFIX_VIRTUAL; 62 | 63 | return $a + array( 64 | $prefix.'hosts' => $c->_hosts(), 65 | $prefix.'function' => ClassStub::wrapCallable($c->_function()), 66 | ); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/ResourceCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts common resource types to array representation. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class ResourceCaster 22 | { 23 | public static function castCurl($h, array $a, Stub $stub, $isNested) 24 | { 25 | return curl_getinfo($h); 26 | } 27 | 28 | public static function castDba($dba, array $a, Stub $stub, $isNested) 29 | { 30 | $list = dba_list(); 31 | $a['file'] = $list[(int) $dba]; 32 | 33 | return $a; 34 | } 35 | 36 | public static function castProcess($process, array $a, Stub $stub, $isNested) 37 | { 38 | return proc_get_status($process); 39 | } 40 | 41 | public static function castStream($stream, array $a, Stub $stub, $isNested) 42 | { 43 | $a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested); 44 | if (isset($a['uri'])) { 45 | $a['uri'] = new LinkStub($a['uri']); 46 | } 47 | 48 | return $a; 49 | } 50 | 51 | public static function castStreamContext($stream, array $a, Stub $stub, $isNested) 52 | { 53 | return @stream_context_get_params($stream) ?: $a; 54 | } 55 | 56 | public static function castGd($gd, array $a, Stub $stub, $isNested) 57 | { 58 | $a['size'] = imagesx($gd).'x'.imagesy($gd); 59 | $a['trueColor'] = imageistruecolor($gd); 60 | 61 | return $a; 62 | } 63 | 64 | public static function castMysqlLink($h, array $a, Stub $stub, $isNested) 65 | { 66 | $a['host'] = mysql_get_host_info($h); 67 | $a['protocol'] = mysql_get_proto_info($h); 68 | $a['server'] = mysql_get_server_info($h); 69 | 70 | return $a; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/StubCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts a caster's Stub. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class StubCaster 22 | { 23 | public static function castStub(Stub $c, array $a, Stub $stub, $isNested) 24 | { 25 | if ($isNested) { 26 | $stub->type = $c->type; 27 | $stub->class = $c->class; 28 | $stub->value = $c->value; 29 | $stub->handle = $c->handle; 30 | $stub->cut = $c->cut; 31 | $stub->attr = $c->attr; 32 | 33 | if (Stub::TYPE_REF === $c->type && !$c->class && is_string($c->value) && !preg_match('//u', $c->value)) { 34 | $stub->type = Stub::TYPE_STRING; 35 | $stub->class = Stub::STRING_BINARY; 36 | } 37 | 38 | $a = array(); 39 | } 40 | 41 | return $a; 42 | } 43 | 44 | public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, $isNested) 45 | { 46 | return $isNested ? $c->preservedSubset : $a; 47 | } 48 | 49 | public static function cutInternals($obj, array $a, Stub $stub, $isNested) 50 | { 51 | if ($isNested) { 52 | $stub->cut += count($a); 53 | 54 | return array(); 55 | } 56 | 57 | return $a; 58 | } 59 | 60 | public static function castEnum(EnumStub $c, array $a, Stub $stub, $isNested) 61 | { 62 | if ($isNested) { 63 | $stub->class = $c->dumpKeys ? '' : null; 64 | $stub->handle = 0; 65 | $stub->value = null; 66 | $stub->cut = $c->cut; 67 | $stub->attr = $c->attr; 68 | 69 | $a = array(); 70 | 71 | if ($c->value) { 72 | foreach (array_keys($c->value) as $k) { 73 | $keys[] = !isset($k[0]) || "\0" !== $k[0] ? Caster::PREFIX_VIRTUAL.$k : $k; 74 | } 75 | // Preserve references with array_combine() 76 | $a = array_combine($keys, $c->value); 77 | } 78 | } 79 | 80 | return $a; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/SymfonyCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\HttpFoundation\Request; 15 | use Symfony\Component\VarDumper\Cloner\Stub; 16 | 17 | class SymfonyCaster 18 | { 19 | private static $requestGetters = array( 20 | 'pathInfo' => 'getPathInfo', 21 | 'requestUri' => 'getRequestUri', 22 | 'baseUrl' => 'getBaseUrl', 23 | 'basePath' => 'getBasePath', 24 | 'method' => 'getMethod', 25 | 'format' => 'getRequestFormat', 26 | ); 27 | 28 | public static function castRequest(Request $request, array $a, Stub $stub, $isNested) 29 | { 30 | $clone = null; 31 | 32 | foreach (self::$requestGetters as $prop => $getter) { 33 | if (null === $a[Caster::PREFIX_PROTECTED.$prop]) { 34 | if (null === $clone) { 35 | $clone = clone $request; 36 | } 37 | $a[Caster::PREFIX_VIRTUAL.$prop] = $clone->{$getter}(); 38 | } 39 | } 40 | 41 | return $a; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/TraceStub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Represents a backtrace as returned by debug_backtrace() or Exception->getTrace(). 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class TraceStub extends Stub 22 | { 23 | public $keepArgs; 24 | public $sliceOffset; 25 | public $sliceLength; 26 | public $numberingOffset; 27 | 28 | public function __construct(array $trace, bool $keepArgs = true, int $sliceOffset = 0, int $sliceLength = null, int $numberingOffset = 0) 29 | { 30 | $this->value = $trace; 31 | $this->keepArgs = $keepArgs; 32 | $this->sliceOffset = $sliceOffset; 33 | $this->sliceLength = $sliceLength; 34 | $this->numberingOffset = $numberingOffset; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/XmlReaderCaster.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | namespace Symfony\Component\VarDumper\Caster; 12 | 13 | use Symfony\Component\VarDumper\Cloner\Stub; 14 | 15 | /** 16 | * Casts XmlReader class to array representation. 17 | * 18 | * @author Baptiste Clavié 19 | */ 20 | class XmlReaderCaster 21 | { 22 | private static $nodeTypes = array( 23 | \XMLReader::NONE => 'NONE', 24 | \XMLReader::ELEMENT => 'ELEMENT', 25 | \XMLReader::ATTRIBUTE => 'ATTRIBUTE', 26 | \XMLReader::TEXT => 'TEXT', 27 | \XMLReader::CDATA => 'CDATA', 28 | \XMLReader::ENTITY_REF => 'ENTITY_REF', 29 | \XMLReader::ENTITY => 'ENTITY', 30 | \XMLReader::PI => 'PI (Processing Instruction)', 31 | \XMLReader::COMMENT => 'COMMENT', 32 | \XMLReader::DOC => 'DOC', 33 | \XMLReader::DOC_TYPE => 'DOC_TYPE', 34 | \XMLReader::DOC_FRAGMENT => 'DOC_FRAGMENT', 35 | \XMLReader::NOTATION => 'NOTATION', 36 | \XMLReader::WHITESPACE => 'WHITESPACE', 37 | \XMLReader::SIGNIFICANT_WHITESPACE => 'SIGNIFICANT_WHITESPACE', 38 | \XMLReader::END_ELEMENT => 'END_ELEMENT', 39 | \XMLReader::END_ENTITY => 'END_ENTITY', 40 | \XMLReader::XML_DECLARATION => 'XML_DECLARATION', 41 | ); 42 | 43 | public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, $isNested) 44 | { 45 | $props = Caster::PREFIX_VIRTUAL.'parserProperties'; 46 | $info = array( 47 | 'localName' => $reader->localName, 48 | 'prefix' => $reader->prefix, 49 | 'nodeType' => new ConstStub(self::$nodeTypes[$reader->nodeType], $reader->nodeType), 50 | 'depth' => $reader->depth, 51 | 'isDefault' => $reader->isDefault, 52 | 'isEmptyElement' => \XMLReader::NONE === $reader->nodeType ? null : $reader->isEmptyElement, 53 | 'xmlLang' => $reader->xmlLang, 54 | 'attributeCount' => $reader->attributeCount, 55 | 'value' => $reader->value, 56 | 'namespaceURI' => $reader->namespaceURI, 57 | 'baseURI' => $reader->baseURI ? new LinkStub($reader->baseURI) : $reader->baseURI, 58 | $props => array( 59 | 'LOADDTD' => $reader->getParserProperty(\XMLReader::LOADDTD), 60 | 'DEFAULTATTRS' => $reader->getParserProperty(\XMLReader::DEFAULTATTRS), 61 | 'VALIDATE' => $reader->getParserProperty(\XMLReader::VALIDATE), 62 | 'SUBST_ENTITIES' => $reader->getParserProperty(\XMLReader::SUBST_ENTITIES), 63 | ), 64 | ); 65 | 66 | if ($info[$props] = Caster::filter($info[$props], Caster::EXCLUDE_EMPTY, array(), $count)) { 67 | $info[$props] = new EnumStub($info[$props]); 68 | $info[$props]->cut = $count; 69 | } 70 | 71 | $info = Caster::filter($info, Caster::EXCLUDE_EMPTY, array(), $count); 72 | // +2 because hasValue and hasAttributes are always filtered 73 | $stub->cut += $count + 2; 74 | 75 | return $a + $info; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Caster/XmlResourceCaster.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Caster; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Stub; 15 | 16 | /** 17 | * Casts XML resources to array representation. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | class XmlResourceCaster 22 | { 23 | private static $xmlErrors = array( 24 | XML_ERROR_NONE => 'XML_ERROR_NONE', 25 | XML_ERROR_NO_MEMORY => 'XML_ERROR_NO_MEMORY', 26 | XML_ERROR_SYNTAX => 'XML_ERROR_SYNTAX', 27 | XML_ERROR_NO_ELEMENTS => 'XML_ERROR_NO_ELEMENTS', 28 | XML_ERROR_INVALID_TOKEN => 'XML_ERROR_INVALID_TOKEN', 29 | XML_ERROR_UNCLOSED_TOKEN => 'XML_ERROR_UNCLOSED_TOKEN', 30 | XML_ERROR_PARTIAL_CHAR => 'XML_ERROR_PARTIAL_CHAR', 31 | XML_ERROR_TAG_MISMATCH => 'XML_ERROR_TAG_MISMATCH', 32 | XML_ERROR_DUPLICATE_ATTRIBUTE => 'XML_ERROR_DUPLICATE_ATTRIBUTE', 33 | XML_ERROR_JUNK_AFTER_DOC_ELEMENT => 'XML_ERROR_JUNK_AFTER_DOC_ELEMENT', 34 | XML_ERROR_PARAM_ENTITY_REF => 'XML_ERROR_PARAM_ENTITY_REF', 35 | XML_ERROR_UNDEFINED_ENTITY => 'XML_ERROR_UNDEFINED_ENTITY', 36 | XML_ERROR_RECURSIVE_ENTITY_REF => 'XML_ERROR_RECURSIVE_ENTITY_REF', 37 | XML_ERROR_ASYNC_ENTITY => 'XML_ERROR_ASYNC_ENTITY', 38 | XML_ERROR_BAD_CHAR_REF => 'XML_ERROR_BAD_CHAR_REF', 39 | XML_ERROR_BINARY_ENTITY_REF => 'XML_ERROR_BINARY_ENTITY_REF', 40 | XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF => 'XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF', 41 | XML_ERROR_MISPLACED_XML_PI => 'XML_ERROR_MISPLACED_XML_PI', 42 | XML_ERROR_UNKNOWN_ENCODING => 'XML_ERROR_UNKNOWN_ENCODING', 43 | XML_ERROR_INCORRECT_ENCODING => 'XML_ERROR_INCORRECT_ENCODING', 44 | XML_ERROR_UNCLOSED_CDATA_SECTION => 'XML_ERROR_UNCLOSED_CDATA_SECTION', 45 | XML_ERROR_EXTERNAL_ENTITY_HANDLING => 'XML_ERROR_EXTERNAL_ENTITY_HANDLING', 46 | ); 47 | 48 | public static function castXml($h, array $a, Stub $stub, $isNested) 49 | { 50 | $a['current_byte_index'] = xml_get_current_byte_index($h); 51 | $a['current_column_number'] = xml_get_current_column_number($h); 52 | $a['current_line_number'] = xml_get_current_line_number($h); 53 | $a['error_code'] = xml_get_error_code($h); 54 | 55 | if (isset(self::$xmlErrors[$a['error_code']])) { 56 | $a['error_code'] = new ConstStub(self::$xmlErrors[$a['error_code']], $a['error_code']); 57 | } 58 | 59 | return $a; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/ClonerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * @author Nicolas Grekas 16 | */ 17 | interface ClonerInterface 18 | { 19 | /** 20 | * Clones a PHP variable. 21 | * 22 | * @param mixed $var Any PHP variable 23 | * 24 | * @return Data The cloned variable represented by a Data object 25 | */ 26 | public function cloneVar($var); 27 | } 28 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/Cursor.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * Represents the current state of a dumper while dumping. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class Cursor 20 | { 21 | const HASH_INDEXED = Stub::ARRAY_INDEXED; 22 | const HASH_ASSOC = Stub::ARRAY_ASSOC; 23 | const HASH_OBJECT = Stub::TYPE_OBJECT; 24 | const HASH_RESOURCE = Stub::TYPE_RESOURCE; 25 | 26 | public $depth = 0; 27 | public $refIndex = 0; 28 | public $softRefTo = 0; 29 | public $softRefCount = 0; 30 | public $softRefHandle = 0; 31 | public $hardRefTo = 0; 32 | public $hardRefCount = 0; 33 | public $hardRefHandle = 0; 34 | public $hashType; 35 | public $hashKey; 36 | public $hashKeyIsBinary; 37 | public $hashIndex = 0; 38 | public $hashLength = 0; 39 | public $hashCut = 0; 40 | public $stop = false; 41 | public $attr = array(); 42 | public $skipChildren = false; 43 | } 44 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/DumperInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * DumperInterface used by Data objects. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | interface DumperInterface 20 | { 21 | /** 22 | * Dumps a scalar value. 23 | * 24 | * @param Cursor $cursor The Cursor position in the dump 25 | * @param string $type The PHP type of the value being dumped 26 | * @param string|int|float|bool $value The scalar value being dumped 27 | */ 28 | public function dumpScalar(Cursor $cursor, $type, $value); 29 | 30 | /** 31 | * Dumps a string. 32 | * 33 | * @param Cursor $cursor The Cursor position in the dump 34 | * @param string $str The string being dumped 35 | * @param bool $bin Whether $str is UTF-8 or binary encoded 36 | * @param int $cut The number of characters $str has been cut by 37 | */ 38 | public function dumpString(Cursor $cursor, $str, $bin, $cut); 39 | 40 | /** 41 | * Dumps while entering an hash. 42 | * 43 | * @param Cursor $cursor The Cursor position in the dump 44 | * @param int $type A Cursor::HASH_* const for the type of hash 45 | * @param string $class The object class, resource type or array count 46 | * @param bool $hasChild When the dump of the hash has child item 47 | */ 48 | public function enterHash(Cursor $cursor, $type, $class, $hasChild); 49 | 50 | /** 51 | * Dumps while leaving an hash. 52 | * 53 | * @param Cursor $cursor The Cursor position in the dump 54 | * @param int $type A Cursor::HASH_* const for the type of hash 55 | * @param string $class The object class, resource type or array count 56 | * @param bool $hasChild When the dump of the hash has child item 57 | * @param int $cut The number of items the hash has been cut by 58 | */ 59 | public function leaveHash(Cursor $cursor, $type, $class, $hasChild, $cut); 60 | } 61 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Cloner/Stub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Cloner; 13 | 14 | /** 15 | * Represents the main properties of a PHP variable. 16 | * 17 | * @author Nicolas Grekas 18 | */ 19 | class Stub implements \Serializable 20 | { 21 | const TYPE_REF = 1; 22 | const TYPE_STRING = 2; 23 | const TYPE_ARRAY = 3; 24 | const TYPE_OBJECT = 4; 25 | const TYPE_RESOURCE = 5; 26 | 27 | const STRING_BINARY = 1; 28 | const STRING_UTF8 = 2; 29 | 30 | const ARRAY_ASSOC = 1; 31 | const ARRAY_INDEXED = 2; 32 | 33 | public $type = self::TYPE_REF; 34 | public $class = ''; 35 | public $value; 36 | public $cut = 0; 37 | public $handle = 0; 38 | public $refCount = 0; 39 | public $position = 0; 40 | public $attr = array(); 41 | 42 | /** 43 | * @internal 44 | */ 45 | public function serialize() 46 | { 47 | return \serialize(array($this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr)); 48 | } 49 | 50 | /** 51 | * @internal 52 | */ 53 | public function unserialize($serialized) 54 | { 55 | list($this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr) = \unserialize($serialized); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Dumper/DataDumperInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Dumper; 13 | 14 | use Symfony\Component\VarDumper\Cloner\Data; 15 | 16 | /** 17 | * DataDumperInterface for dumping Data objects. 18 | * 19 | * @author Nicolas Grekas 20 | */ 21 | interface DataDumperInterface 22 | { 23 | public function dump(Data $data); 24 | } 25 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Exception/ThrowingCasterException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Exception; 13 | 14 | /** 15 | * @author Nicolas Grekas 16 | */ 17 | class ThrowingCasterException extends \Exception 18 | { 19 | /** 20 | * @param \Exception $prev The exception thrown from the caster 21 | */ 22 | public function __construct(\Exception $prev) 23 | { 24 | parent::__construct('Unexpected '.get_class($prev).' thrown from a caster: '.$prev->getMessage(), 0, $prev); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2018 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/README.md: -------------------------------------------------------------------------------- 1 | VarDumper Component 2 | =================== 3 | 4 | The VarDumper component provides mechanisms for walking through any arbitrary 5 | PHP variable. Built on top, it provides a better `dump()` function that you 6 | can use instead of `var_dump`. 7 | 8 | Resources 9 | --------- 10 | 11 | * [Documentation](https://symfony.com/doc/current/components/var_dumper/introduction.html) 12 | * [Contributing](https://symfony.com/doc/current/contributing/index.html) 13 | * [Report issues](https://github.com/symfony/symfony/issues) and 14 | [send Pull Requests](https://github.com/symfony/symfony/pulls) 15 | in the [main Symfony repository](https://github.com/symfony/symfony) 16 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Resources/functions/dump.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Symfony\Component\VarDumper\VarDumper; 13 | 14 | if (!function_exists('dump')) { 15 | /** 16 | * @author Nicolas Grekas 17 | */ 18 | function dump($var, ...$moreVars) 19 | { 20 | VarDumper::dump($var); 21 | 22 | foreach ($moreVars as $var) { 23 | VarDumper::dump($var); 24 | } 25 | 26 | if (1 < func_num_args()) { 27 | return func_get_args(); 28 | } 29 | 30 | return $var; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Test/VarDumperTestTrait.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Test; 13 | 14 | use Symfony\Component\VarDumper\Cloner\VarCloner; 15 | use Symfony\Component\VarDumper\Dumper\CliDumper; 16 | 17 | /** 18 | * @author Nicolas Grekas 19 | */ 20 | trait VarDumperTestTrait 21 | { 22 | public function assertDumpEquals($dump, $data, $filter = 0, $message = '') 23 | { 24 | $this->assertSame(rtrim($dump), $this->getDump($data, null, $filter), $message); 25 | } 26 | 27 | public function assertDumpMatchesFormat($dump, $data, $filter = 0, $message = '') 28 | { 29 | $this->assertStringMatchesFormat(rtrim($dump), $this->getDump($data, null, $filter), $message); 30 | } 31 | 32 | protected function getDump($data, $key = null, $filter = 0) 33 | { 34 | $flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0; 35 | $flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0; 36 | 37 | $cloner = new VarCloner(); 38 | $cloner->setMaxItems(-1); 39 | $dumper = new CliDumper(null, null, $flags); 40 | $dumper->setColors(false); 41 | $data = $cloner->cloneVar($data, $filter)->withRefHandles(false); 42 | if (null !== $key && null === $data = $data->seek($key)) { 43 | return; 44 | } 45 | 46 | return rtrim($dumper->dump($data, true)); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Tests/Caster/PdoCasterTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Tests\Caster; 13 | 14 | use PHPUnit\Framework\TestCase; 15 | use Symfony\Component\VarDumper\Caster\PdoCaster; 16 | use Symfony\Component\VarDumper\Cloner\Stub; 17 | use Symfony\Component\VarDumper\Test\VarDumperTestTrait; 18 | 19 | /** 20 | * @author Nicolas Grekas 21 | */ 22 | class PdoCasterTest extends TestCase 23 | { 24 | use VarDumperTestTrait; 25 | 26 | /** 27 | * @requires extension pdo_sqlite 28 | */ 29 | public function testCastPdo() 30 | { 31 | $pdo = new \PDO('sqlite::memory:'); 32 | $pdo->setAttribute(\PDO::ATTR_STATEMENT_CLASS, array('PDOStatement', array($pdo))); 33 | 34 | $cast = PdoCaster::castPdo($pdo, array(), new Stub(), false); 35 | 36 | $this->assertInstanceOf('Symfony\Component\VarDumper\Caster\EnumStub', $cast["\0~\0attributes"]); 37 | 38 | $attr = $cast["\0~\0attributes"] = $cast["\0~\0attributes"]->value; 39 | $this->assertInstanceOf('Symfony\Component\VarDumper\Caster\ConstStub', $attr['CASE']); 40 | $this->assertSame('NATURAL', $attr['CASE']->class); 41 | $this->assertSame('BOTH', $attr['DEFAULT_FETCH_MODE']->class); 42 | 43 | $xDump = <<<'EODUMP' 44 | array:2 [ 45 | "\x00~\x00inTransaction" => false 46 | "\x00~\x00attributes" => array:9 [ 47 | "CASE" => NATURAL 48 | "ERRMODE" => SILENT 49 | "PERSISTENT" => false 50 | "DRIVER_NAME" => "sqlite" 51 | "ORACLE_NULLS" => NATURAL 52 | "CLIENT_VERSION" => "%s" 53 | "SERVER_VERSION" => "%s" 54 | "STATEMENT_CLASS" => array:%d [ 55 | 0 => "PDOStatement"%A 56 | ] 57 | "DEFAULT_FETCH_MODE" => BOTH 58 | ] 59 | ] 60 | EODUMP; 61 | 62 | $this->assertDumpMatchesFormat($xDump, $cast); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Tests/Caster/RedisCasterTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Tests\Caster; 13 | 14 | use PHPUnit\Framework\TestCase; 15 | use Symfony\Component\VarDumper\Test\VarDumperTestTrait; 16 | 17 | /** 18 | * @author Nicolas Grekas 19 | * @requires extension redis 20 | */ 21 | class RedisCasterTest extends TestCase 22 | { 23 | use VarDumperTestTrait; 24 | 25 | public function testNotConnected() 26 | { 27 | $redis = new \Redis(); 28 | 29 | $xCast = <<<'EODUMP' 30 | Redis { 31 | isConnected: false 32 | } 33 | EODUMP; 34 | 35 | $this->assertDumpMatchesFormat($xCast, $redis); 36 | } 37 | 38 | public function testConnected() 39 | { 40 | $redis = new \Redis(); 41 | if (!@$redis->connect('127.0.0.1')) { 42 | $e = error_get_last(); 43 | self::markTestSkipped($e['message']); 44 | } 45 | 46 | $xCast = <<<'EODUMP' 47 | Redis {%A 48 | isConnected: true 49 | host: "127.0.0.1" 50 | port: 6379 51 | auth: null 52 | dbNum: 0 53 | timeout: 0.0 54 | persistentId: null 55 | options: { 56 | READ_TIMEOUT: 0.0 57 | SERIALIZER: NONE 58 | PREFIX: null 59 | SCAN: NORETRY 60 | } 61 | } 62 | EODUMP; 63 | 64 | $this->assertDumpMatchesFormat($xCast, $redis); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Tests/Fixtures/FooInterface.php: -------------------------------------------------------------------------------- 1 | parent = false; 14 | $this->blocks = array(); 15 | $this->path = $path; 16 | } 17 | 18 | protected function doDisplay(array $context, array $blocks = array()) 19 | { 20 | // line 2 21 | throw new \Exception('Foobar'); 22 | } 23 | 24 | public function getTemplateName() 25 | { 26 | return 'foo.twig'; 27 | } 28 | 29 | public function getDebugInfo() 30 | { 31 | return array(20 => 1, 21 => 2); 32 | } 33 | 34 | public function getSourceContext() 35 | { 36 | return new Twig\Source(" foo bar\n twig source\n\n", 'foo.twig', $this->path ?: __FILE__); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Tests/Fixtures/dumb-var.php: -------------------------------------------------------------------------------- 1 | bar = 'bar'; 14 | 15 | $g = fopen(__FILE__, 'r'); 16 | 17 | $var = array( 18 | 'number' => 1, null, 19 | 'const' => 1.1, true, false, NAN, INF, -INF, PHP_INT_MAX, 20 | 'str' => "déjà\n", "\xE9\x00", 21 | '[]' => array(), 22 | 'res' => $g, 23 | 'obj' => $foo, 24 | 'closure' => function ($a, \PDO &$b = null) {}, 25 | 'line' => __LINE__ - 1, 26 | 'nobj' => array((object) array()), 27 | ); 28 | 29 | $r = array(); 30 | $r[] = &$r; 31 | 32 | $var['recurs'] = &$r; 33 | $var[] = &$var[0]; 34 | $var['sobj'] = $var['obj']; 35 | $var['snobj'] = &$var['nobj'][0]; 36 | $var['snobj2'] = $var['nobj'][0]; 37 | $var['file'] = __FILE__; 38 | $var["bin-key-\xE9"] = ''; 39 | 40 | unset($g, $r); 41 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Tests/Fixtures/xml_reader.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | With text 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/Tests/Test/VarDumperTestTraitTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper\Tests\Test; 13 | 14 | use PHPUnit\Framework\TestCase; 15 | use Symfony\Component\VarDumper\Test\VarDumperTestTrait; 16 | 17 | class VarDumperTestTraitTest extends TestCase 18 | { 19 | use VarDumperTestTrait; 20 | 21 | public function testItComparesLargeData() 22 | { 23 | $howMany = 700; 24 | $data = array_fill_keys(range(0, $howMany), array('a', 'b', 'c', 'd')); 25 | 26 | $expected = sprintf("array:%d [\n", $howMany + 1); 27 | for ($i = 0; $i <= $howMany; ++$i) { 28 | $expected .= << array:4 [ 30 | 0 => "a" 31 | 1 => "b" 32 | 2 => "c" 33 | 3 => "d" 34 | ]\n 35 | EODUMP; 36 | } 37 | $expected .= "]\n"; 38 | 39 | $this->assertDumpEquals($expected, $data); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/VarDumper.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Component\VarDumper; 13 | 14 | use Symfony\Component\VarDumper\Cloner\VarCloner; 15 | use Symfony\Component\VarDumper\Dumper\CliDumper; 16 | use Symfony\Component\VarDumper\Dumper\HtmlDumper; 17 | 18 | // Load the global dump() function 19 | require_once __DIR__.'/Resources/functions/dump.php'; 20 | 21 | /** 22 | * @author Nicolas Grekas 23 | */ 24 | class VarDumper 25 | { 26 | private static $handler; 27 | 28 | public static function dump($var) 29 | { 30 | if (null === self::$handler) { 31 | $cloner = new VarCloner(); 32 | $dumper = in_array(PHP_SAPI, array('cli', 'phpdbg')) ? new CliDumper() : new HtmlDumper(); 33 | self::$handler = function ($var) use ($cloner, $dumper) { 34 | $dumper->dump($cloner->cloneVar($var)); 35 | }; 36 | } 37 | 38 | return call_user_func(self::$handler, $var); 39 | } 40 | 41 | public static function setHandler(callable $callable = null) 42 | { 43 | $prevHandler = self::$handler; 44 | self::$handler = $callable; 45 | 46 | return $prevHandler; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/var-dumper", 3 | "type": "library", 4 | "description": "Symfony mechanism for exploring and dumping PHP variables", 5 | "keywords": ["dump", "debug"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Nicolas Grekas", 11 | "email": "p@tchwork.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": "^7.1.3", 20 | "symfony/polyfill-mbstring": "~1.0", 21 | "symfony/polyfill-php72": "~1.5" 22 | }, 23 | "require-dev": { 24 | "ext-iconv": "*", 25 | "twig/twig": "~1.34|~2.4" 26 | }, 27 | "conflict": { 28 | "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" 29 | }, 30 | "suggest": { 31 | "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", 32 | "ext-intl": "To show region name in time zone dump" 33 | }, 34 | "autoload": { 35 | "files": [ "Resources/functions/dump.php" ], 36 | "psr-4": { "Symfony\\Component\\VarDumper\\": "" }, 37 | "exclude-from-classmap": [ 38 | "/Tests/" 39 | ] 40 | }, 41 | "minimum-stability": "dev", 42 | "extra": { 43 | "branch-alias": { 44 | "dev-master": "4.0-dev" 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/symfony/var-dumper/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | ./Tests/ 20 | 21 | 22 | 23 | 24 | 25 | ./ 26 | 27 | ./Resources 28 | ./Tests 29 | ./vendor 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /src/Collect/Support/Carbon.php 3 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 7.1 5 | - 7.2 6 | - nightly 7 | 8 | sudo: false 9 | 10 | cache: 11 | directories: 12 | - $HOME/.composer/cache 13 | 14 | before_script: 15 | - travis_retry composer self-update 16 | - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist 17 | 18 | script: 19 | - bash upgrade.sh 20 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/collect-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yhf7952/mmPic/900f434ac84f2c608b8691fb2f0af5cfe0bfd83f/vendor/tightenco/collect/collect-logo.png -------------------------------------------------------------------------------- /vendor/tightenco/collect/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tightenco/collect", 3 | "description": "Collect - Illuminate Collections as a separate package.", 4 | "keywords": ["laravel", "collection"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Taylor Otwell", 9 | "email": "taylorotwell@gmail.com" 10 | } 11 | ], 12 | "require": { 13 | "php": ">=7.1.3", 14 | "symfony/var-dumper": ">=3.1.10" 15 | }, 16 | "require-dev": { 17 | "mockery/mockery": "~1.0", 18 | "phpunit/phpunit": "~7.0", 19 | "nesbot/carbon": "~1.20" 20 | }, 21 | "autoload": { 22 | "files": [ 23 | "src/Collect/Support/helpers.php", 24 | "src/Collect/Support/alias.php" 25 | ], 26 | "psr-4": { 27 | "Tightenco\\Collect\\": "src/Collect" 28 | } 29 | }, 30 | "scripts": { 31 | "test": [ 32 | "@composer install", 33 | "vendor/bin/phpunit" 34 | ] 35 | }, 36 | "minimum-stability": "dev", 37 | "prefer-stable": true 38 | } 39 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | ./tests 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/readme.md: -------------------------------------------------------------------------------- 1 | [![Travis Status for tightenco/collect](https://travis-ci.org/tightenco/collect.svg?branch=master)](https://travis-ci.org/tightenco/collect) 2 | 3 | ![](https://raw.githubusercontent.com/tightenco/collect/master/collect-logo.png) 4 | 5 | # Collect - Illuminate Collections 6 | 7 | Import [Laravel's Collections](https://laravel.com/docs/collections) into non-Laravel packages easily, without needing to require the entire `Illuminate\Support` package. ([Why not pull `Illuminate\Support` in framework-agnostic packages](https://yuloh.github.io/2016/dont-use-illuminate-support/)) 8 | 9 | Written by Taylor Otwell as a part of Laravel's [Illuminate/Support](https://github.com/illuminate/support) package, Collect is just the code from Support needed in order to use Collections on their own. 10 | 11 | Lovingly split by Matt Stauffer for [Tighten Co.](https://tighten.co/), with a kick in the butt to finally do it from [@assertchris](https://github.com/assertchris). 12 | 13 | ## Installation 14 | 15 | With [Composer](https://getcomposer.org): 16 | 17 | ```bash 18 | composer require tightenco/collect 19 | ``` 20 | 21 | 22 | ## FAQ 23 | - **Will this develop independently from Illuminate's Collections?** 24 | No. Right now it's split manually, but the goal is for it shortly to be split automatically to keep it in sync with Laravel's Collections, even mirroring the release numbers. 25 | - **Why is the package `tightenco/collect` instead of `illuminate/collect`?** 26 | It's not an official Laravel package so we don't want to use the Packagist namespace reserved by Laravel packages. One day `Collection` may be extracted from `illuminate/support` to a new package. If so, we'll deprecate this package and point to the core version. 27 | - **Why not just use an array?** 28 | What a great question. [Tighten alum Adam Wathan has a book about that.](https://adamwathan.me/refactoring-to-collections/) 29 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/src/Collect/Contracts/Support/Arrayable.php: -------------------------------------------------------------------------------- 1 | dump((new VarCloner)->cloneVar($value)); 22 | } else { 23 | var_dump($value); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/src/Collect/Support/Debug/HtmlDumper.php: -------------------------------------------------------------------------------- 1 | 'background-color:#fff; color:#222; line-height:1.2em; font-weight:normal; font:12px Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:100000', 16 | 'num' => 'color:#a71d5d', 17 | 'const' => 'color:#795da3', 18 | 'str' => 'color:#df5000', 19 | 'cchr' => 'color:#222', 20 | 'note' => 'color:#a71d5d', 21 | 'ref' => 'color:#a0a0a0', 22 | 'public' => 'color:#795da3', 23 | 'protected' => 'color:#795da3', 24 | 'private' => 'color:#795da3', 25 | 'meta' => 'color:#b729d9', 26 | 'key' => 'color:#df5000', 27 | 'index' => 'color:#a71d5d', 28 | ]; 29 | } 30 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/src/Collect/Support/HigherOrderCollectionProxy.php: -------------------------------------------------------------------------------- 1 | method = $method; 34 | $this->collection = $collection; 35 | } 36 | 37 | /** 38 | * Proxy accessing an attribute onto the collection items. 39 | * 40 | * @param string $key 41 | * @return mixed 42 | */ 43 | public function __get($key) 44 | { 45 | return $this->collection->{$this->method}(function ($value) use ($key) { 46 | return is_array($value) ? $value[$key] : $value->{$key}; 47 | }); 48 | } 49 | 50 | /** 51 | * Proxy a method call onto the collection items. 52 | * 53 | * @param string $method 54 | * @param array $parameters 55 | * @return mixed 56 | */ 57 | public function __call($method, $parameters) 58 | { 59 | return $this->collection->{$this->method}(function ($value) use ($method, $parameters) { 60 | return $value->{$method}(...$parameters); 61 | }); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/src/Collect/Support/HtmlString.php: -------------------------------------------------------------------------------- 1 | html = $html; 25 | } 26 | 27 | /** 28 | * Get the HTML string. 29 | * 30 | * @return string 31 | */ 32 | public function toHtml() 33 | { 34 | return $this->html; 35 | } 36 | 37 | /** 38 | * Get the HTML string. 39 | * 40 | * @return string 41 | */ 42 | public function __toString() 43 | { 44 | return $this->toHtml(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/src/Collect/Support/Traits/Macroable.php: -------------------------------------------------------------------------------- 1 | getMethods( 41 | ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED 42 | ); 43 | 44 | foreach ($methods as $method) { 45 | $method->setAccessible(true); 46 | 47 | static::macro($method->name, $method->invoke($mixin)); 48 | } 49 | } 50 | 51 | /** 52 | * Checks if macro is registered. 53 | * 54 | * @param string $name 55 | * @return bool 56 | */ 57 | public static function hasMacro($name) 58 | { 59 | return isset(static::$macros[$name]); 60 | } 61 | 62 | /** 63 | * Dynamically handle calls to the class. 64 | * 65 | * @param string $method 66 | * @param array $parameters 67 | * @return mixed 68 | * 69 | * @throws \BadMethodCallException 70 | */ 71 | public static function __callStatic($method, $parameters) 72 | { 73 | if (! static::hasMacro($method)) { 74 | throw new BadMethodCallException(sprintf( 75 | 'Method %s::%s does not exist.', static::class, $method 76 | )); 77 | } 78 | 79 | if (static::$macros[$method] instanceof Closure) { 80 | return call_user_func_array(Closure::bind(static::$macros[$method], null, static::class), $parameters); 81 | } 82 | 83 | return call_user_func_array(static::$macros[$method], $parameters); 84 | } 85 | 86 | /** 87 | * Dynamically handle calls to the class. 88 | * 89 | * @param string $method 90 | * @param array $parameters 91 | * @return mixed 92 | * 93 | * @throws \BadMethodCallException 94 | */ 95 | public function __call($method, $parameters) 96 | { 97 | if (! static::hasMacro($method)) { 98 | throw new BadMethodCallException(sprintf( 99 | 'Method %s::%s does not exist.', static::class, $method 100 | )); 101 | } 102 | 103 | $macro = static::$macros[$method]; 104 | 105 | if ($macro instanceof Closure) { 106 | return call_user_func_array($macro->bindTo($this, static::class), $parameters); 107 | } 108 | 109 | return call_user_func_array($macro, $parameters); 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/src/Collect/Support/alias.php: -------------------------------------------------------------------------------- 1 | Illuminate\Contracts\Support\Arrayable::class, 5 | Tightenco\Collect\Contracts\Support\Jsonable::class => Illuminate\Contracts\Support\Jsonable::class, 6 | Tightenco\Collect\Contracts\Support\Htmlable::class => Illuminate\Contracts\Support\Htmlable::class, 7 | Tightenco\Collect\Support\Collection::class => Illuminate\Support\Collection::class, 8 | Tightenco\Collect\Support\Arr::class => Illuminate\Support\Arr::class, 9 | Tightenco\Collect\Support\HigherOrderCollectionProxy::class => Illuminate\Support\HigherOrderCollectionProxy::class, 10 | Tightenco\Collect\Support\HtmlString::class => Illuminate\Support\HtmlString::class, 11 | Tightenco\Collect\Support\Debug\Dumper::class => Illuminate\Support\Debug\Dumper::class, 12 | Tightenco\Collect\Support\Debug\HtmlDumper::class => Illuminate\Support\Debug\HtmlDumper::class, 13 | Tightenco\Collect\Support\Traits\Macroable::class => Illuminate\Support\Traits\Macroable::class, 14 | ]; 15 | 16 | foreach ($aliases as $tighten => $illuminate) { 17 | if (! class_exists($illuminate) && ! interface_exists($illuminate) && ! trait_exists($illuminate)) { 18 | class_alias($tighten, $illuminate); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/src/Collect/Support/helpers.php: -------------------------------------------------------------------------------- 1 | all(); 68 | } elseif (! is_array($target)) { 69 | return value($default); 70 | } 71 | 72 | $result = Arr::pluck($target, $key); 73 | 74 | return in_array('*', $key) ? Arr::collapse($result) : $result; 75 | } 76 | 77 | if (Arr::accessible($target) && Arr::exists($target, $segment)) { 78 | $target = $target[$segment]; 79 | } elseif (is_object($target) && isset($target->{$segment})) { 80 | $target = $target->{$segment}; 81 | } else { 82 | return value($default); 83 | } 84 | } 85 | 86 | return $target; 87 | } 88 | } 89 | 90 | if (! function_exists('with')) { 91 | /** 92 | * Return the given object. Useful for chaining. 93 | * 94 | * @param mixed $object 95 | * @return mixed 96 | */ 97 | function with($object) 98 | { 99 | return $object; 100 | } 101 | } 102 | 103 | if (! function_exists('dd')) { 104 | /** 105 | * Dump the passed variables and end the script. 106 | * 107 | * @param mixed 108 | * @return void 109 | */ 110 | function dd(...$args) 111 | { 112 | foreach ($args as $x) { 113 | (new Dumper)->dump($x); 114 | } 115 | die(1); 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/stubs/src/Collect/Support/alias.php: -------------------------------------------------------------------------------- 1 | $illuminate) { 6 | if (! class_exists($illuminate) && ! interface_exists($illuminate) && ! trait_exists($illuminate)) { 7 | class_alias($tighten, $illuminate); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/stubs/src/Collect/Support/helpers.php: -------------------------------------------------------------------------------- 1 | all(); 68 | } elseif (! is_array($target)) { 69 | return value($default); 70 | } 71 | 72 | $result = Arr::pluck($target, $key); 73 | 74 | return in_array('*', $key) ? Arr::collapse($result) : $result; 75 | } 76 | 77 | if (Arr::accessible($target) && Arr::exists($target, $segment)) { 78 | $target = $target[$segment]; 79 | } elseif (is_object($target) && isset($target->{$segment})) { 80 | $target = $target->{$segment}; 81 | } else { 82 | return value($default); 83 | } 84 | } 85 | 86 | return $target; 87 | } 88 | } 89 | 90 | if (! function_exists('with')) { 91 | /** 92 | * Return the given object. Useful for chaining. 93 | * 94 | * @param mixed $object 95 | * @return mixed 96 | */ 97 | function with($object) 98 | { 99 | return $object; 100 | } 101 | } 102 | 103 | if (! function_exists('dd')) { 104 | /** 105 | * Dump the passed variables and end the script. 106 | * 107 | * @param mixed 108 | * @return void 109 | */ 110 | function dd(...$args) 111 | { 112 | foreach ($args as $x) { 113 | (new Dumper)->dump($x); 114 | } 115 | die(1); 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/stubs/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | macroable = $this->createObjectForTrait(); 15 | } 16 | 17 | private function createObjectForTrait() 18 | { 19 | return $this->getObjectForTrait(Macroable::class); 20 | } 21 | 22 | public function testRegisterMacro() 23 | { 24 | $macroable = $this->macroable; 25 | $macroable::macro(__CLASS__, function () { 26 | return 'Taylor'; 27 | }); 28 | $this->assertEquals('Taylor', $macroable::{__CLASS__}()); 29 | } 30 | 31 | public function testRegisterMacroAndCallWithoutStatic() 32 | { 33 | $macroable = $this->macroable; 34 | $macroable::macro(__CLASS__, function () { 35 | return 'Taylor'; 36 | }); 37 | $this->assertEquals('Taylor', $macroable->{__CLASS__}()); 38 | } 39 | 40 | public function testWhenCallingMacroClosureIsBoundToObject() 41 | { 42 | TestMacroable::macro('tryInstance', function () { 43 | return $this->protectedVariable; 44 | }); 45 | TestMacroable::macro('tryStatic', function () { 46 | return static::getProtectedStatic(); 47 | }); 48 | $instance = new TestMacroable; 49 | 50 | $result = $instance->tryInstance(); 51 | $this->assertEquals('instance', $result); 52 | 53 | $result = TestMacroable::tryStatic(); 54 | $this->assertEquals('static', $result); 55 | } 56 | 57 | public function testClassBasedMacros() 58 | { 59 | TestMacroable::mixin(new TestMixin); 60 | $instance = new TestMacroable; 61 | $this->assertEquals('instance-Adam', $instance->methodOne('Adam')); 62 | } 63 | } 64 | 65 | class TestMacroable 66 | { 67 | use Macroable; 68 | 69 | protected $protectedVariable = 'instance'; 70 | 71 | protected static function getProtectedStatic() 72 | { 73 | return 'static'; 74 | } 75 | } 76 | 77 | class TestMixin 78 | { 79 | public function methodOne() 80 | { 81 | return function ($value) { 82 | return $this->methodTwo($value); 83 | }; 84 | } 85 | 86 | protected function methodTwo() 87 | { 88 | return function ($value) { 89 | return $this->protectedVariable.'-'.$value; 90 | }; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /vendor/tightenco/collect/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 |