├── .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 |
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é
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 |
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 |