├── .gitignore ├── LICENSE ├── README.md ├── composer.json ├── composer.lock ├── src ├── BaseFace.php ├── Bill.php ├── Clothing.php ├── Exception │ └── FetchImageException.php ├── Foundation │ ├── Api.php │ ├── Face.php │ └── ServiceProviders │ │ ├── BillServiceProvider.php │ │ ├── ClothingServiceProvider.php │ │ ├── PoemServiceProvider.php │ │ ├── PopularServiceProvider.php │ │ ├── RelationServiceProvider.php │ │ └── ScoreServiceProvider.php ├── Poem.php ├── Popular.php ├── Relation.php └── Score.php └── tests └── BasicTest.php /.gitignore: -------------------------------------------------------------------------------- 1 | composer.phar 2 | /vendor/ 3 | .idea 4 | 5 | # Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file 6 | # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file 7 | # composer.lock 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 HanSon 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # face 2 | 3 | face 是基于微软小冰接口的颜值检测工具 4 | 5 | PS:其中某些接口还有一些参数,能够定位某些tag的位置,但因过于复杂这里没有实现 6 | 7 | ## Install 8 | 9 | ``` 10 | composer require hanson/face 11 | ``` 12 | 13 | ## Usage 14 | 15 | ```php 16 | score->get('https://ws2.sinaimg.cn/large/685b97a1gy1fehkmbi6hvj20u00u07ab.jpg'); 20 | 21 | /** 22 | 23 | [ 24 | 'score' => 6.8, 25 | 'text' => '哥们颜值才6.8分,一下让整体颜值从7.3跌到7.1ORZ', 26 | 'url' => 'http://mediaplatform.trafficmanager.cn/image/fetchimage?key=' 27 | ]; 28 | 29 | **/ 30 | ``` 31 | 32 | ## Document 33 | 34 | ```php 35 | score; 40 | 41 | // 获取受欢迎实例 42 | $instance = $face->popular; 43 | 44 | // 获取关系实例 45 | $instance = $face->relation; 46 | 47 | // 获取请客实例 48 | $instance = $face->bill; 49 | 50 | // 获取时尚穿衣实例 51 | $instance = $face->clothing; 52 | 53 | // 获取赋诗实例 54 | $instance = $face->poem; 55 | 56 | // 所有实例均有一个方法 get 57 | $result = $instance->get($url); 58 | 59 | ``` 60 | 61 | ## Achievement 62 | 63 | ### Score 颜值分数 64 | 65 | ![](https://ooo.0o0.ooo/2017/04/10/58eb894b8c36e.jpg) 66 | 67 | ### Bill 请吃饭 68 | 69 | ![](https://ooo.0o0.ooo/2017/04/10/58eb8d2e2f1db.jpg) 70 | 71 | ### Popular 最受欢迎 72 | 73 | ![](https://ooo.0o0.ooo/2017/04/10/58eb950a6bda9.jpg) 74 | 75 | ### Relation 关系 76 | 77 | ![](https://ooo.0o0.ooo/2017/04/10/58eb97d932144.jpg) 78 | 79 | ### Clothing 穿衣风格 80 | 81 | ![](https://ooo.0o0.ooo/2017/04/10/58eb99f234213.jpg) 82 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hanson/face", 3 | "description": "A package to check human appearance score", 4 | "license": "MIT", 5 | "authors": [ 6 | { 7 | "name": "HanSon", 8 | "email": "h@hanc.cc" 9 | } 10 | ], 11 | "require": { 12 | "guzzlehttp/guzzle": "^6.2", 13 | "pimple/pimple": "^3.0" 14 | }, 15 | "require-dev": { 16 | "phpunit/phpunit": "^6.1" 17 | }, 18 | "autoload": { 19 | "psr-4": { 20 | "Hanson\\Face\\": "src/" 21 | } 22 | }, 23 | "autoload-dev": { 24 | "psr-4": { 25 | "Hanson\\Face\\Tests\\": "tests/" 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "30d9e8d02c0b2a662406bb749ca599b8", 8 | "content-hash": "42cbbd00a8662dc9dbf57ac43a3bf429", 9 | "packages": [ 10 | { 11 | "name": "guzzlehttp/guzzle", 12 | "version": "6.2.3", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/guzzle/guzzle.git", 16 | "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006", 21 | "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006", 22 | "shasum": "", 23 | "mirrors": [ 24 | { 25 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 26 | "preferred": true 27 | } 28 | ] 29 | }, 30 | "require": { 31 | "guzzlehttp/promises": "^1.0", 32 | "guzzlehttp/psr7": "^1.4", 33 | "php": ">=5.5" 34 | }, 35 | "require-dev": { 36 | "ext-curl": "*", 37 | "phpunit/phpunit": "^4.0", 38 | "psr/log": "^1.0" 39 | }, 40 | "type": "library", 41 | "extra": { 42 | "branch-alias": { 43 | "dev-master": "6.2-dev" 44 | } 45 | }, 46 | "autoload": { 47 | "files": [ 48 | "src/functions_include.php" 49 | ], 50 | "psr-4": { 51 | "GuzzleHttp\\": "src/" 52 | } 53 | }, 54 | "notification-url": "https://packagist.org/downloads/", 55 | "license": [ 56 | "MIT" 57 | ], 58 | "authors": [ 59 | { 60 | "name": "Michael Dowling", 61 | "email": "mtdowling@gmail.com", 62 | "homepage": "https://github.com/mtdowling" 63 | } 64 | ], 65 | "description": "Guzzle is a PHP HTTP client library", 66 | "homepage": "http://guzzlephp.org/", 67 | "keywords": [ 68 | "client", 69 | "curl", 70 | "framework", 71 | "http", 72 | "http client", 73 | "rest", 74 | "web service" 75 | ], 76 | "time": "2017-02-28 22:50:30" 77 | }, 78 | { 79 | "name": "guzzlehttp/promises", 80 | "version": "v1.3.1", 81 | "source": { 82 | "type": "git", 83 | "url": "https://github.com/guzzle/promises.git", 84 | "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" 85 | }, 86 | "dist": { 87 | "type": "zip", 88 | "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", 89 | "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", 90 | "shasum": "", 91 | "mirrors": [ 92 | { 93 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 94 | "preferred": true 95 | } 96 | ] 97 | }, 98 | "require": { 99 | "php": ">=5.5.0" 100 | }, 101 | "require-dev": { 102 | "phpunit/phpunit": "^4.0" 103 | }, 104 | "type": "library", 105 | "extra": { 106 | "branch-alias": { 107 | "dev-master": "1.4-dev" 108 | } 109 | }, 110 | "autoload": { 111 | "psr-4": { 112 | "GuzzleHttp\\Promise\\": "src/" 113 | }, 114 | "files": [ 115 | "src/functions_include.php" 116 | ] 117 | }, 118 | "notification-url": "https://packagist.org/downloads/", 119 | "license": [ 120 | "MIT" 121 | ], 122 | "authors": [ 123 | { 124 | "name": "Michael Dowling", 125 | "email": "mtdowling@gmail.com", 126 | "homepage": "https://github.com/mtdowling" 127 | } 128 | ], 129 | "description": "Guzzle promises library", 130 | "keywords": [ 131 | "promise" 132 | ], 133 | "time": "2016-12-20 10:07:11" 134 | }, 135 | { 136 | "name": "guzzlehttp/psr7", 137 | "version": "1.4.2", 138 | "source": { 139 | "type": "git", 140 | "url": "https://github.com/guzzle/psr7.git", 141 | "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" 142 | }, 143 | "dist": { 144 | "type": "zip", 145 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", 146 | "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", 147 | "shasum": "", 148 | "mirrors": [ 149 | { 150 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 151 | "preferred": true 152 | } 153 | ] 154 | }, 155 | "require": { 156 | "php": ">=5.4.0", 157 | "psr/http-message": "~1.0" 158 | }, 159 | "provide": { 160 | "psr/http-message-implementation": "1.0" 161 | }, 162 | "require-dev": { 163 | "phpunit/phpunit": "~4.0" 164 | }, 165 | "type": "library", 166 | "extra": { 167 | "branch-alias": { 168 | "dev-master": "1.4-dev" 169 | } 170 | }, 171 | "autoload": { 172 | "psr-4": { 173 | "GuzzleHttp\\Psr7\\": "src/" 174 | }, 175 | "files": [ 176 | "src/functions_include.php" 177 | ] 178 | }, 179 | "notification-url": "https://packagist.org/downloads/", 180 | "license": [ 181 | "MIT" 182 | ], 183 | "authors": [ 184 | { 185 | "name": "Michael Dowling", 186 | "email": "mtdowling@gmail.com", 187 | "homepage": "https://github.com/mtdowling" 188 | }, 189 | { 190 | "name": "Tobias Schultze", 191 | "homepage": "https://github.com/Tobion" 192 | } 193 | ], 194 | "description": "PSR-7 message implementation that also provides common utility methods", 195 | "keywords": [ 196 | "http", 197 | "message", 198 | "request", 199 | "response", 200 | "stream", 201 | "uri", 202 | "url" 203 | ], 204 | "time": "2017-03-20 17:10:46" 205 | }, 206 | { 207 | "name": "pimple/pimple", 208 | "version": "v3.0.2", 209 | "source": { 210 | "type": "git", 211 | "url": "https://github.com/silexphp/Pimple.git", 212 | "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a" 213 | }, 214 | "dist": { 215 | "type": "zip", 216 | "url": "https://api.github.com/repos/silexphp/Pimple/zipball/a30f7d6e57565a2e1a316e1baf2a483f788b258a", 217 | "reference": "a30f7d6e57565a2e1a316e1baf2a483f788b258a", 218 | "shasum": "", 219 | "mirrors": [ 220 | { 221 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 222 | "preferred": true 223 | } 224 | ] 225 | }, 226 | "require": { 227 | "php": ">=5.3.0" 228 | }, 229 | "type": "library", 230 | "extra": { 231 | "branch-alias": { 232 | "dev-master": "3.0.x-dev" 233 | } 234 | }, 235 | "autoload": { 236 | "psr-0": { 237 | "Pimple": "src/" 238 | } 239 | }, 240 | "notification-url": "https://packagist.org/downloads/", 241 | "license": [ 242 | "MIT" 243 | ], 244 | "authors": [ 245 | { 246 | "name": "Fabien Potencier", 247 | "email": "fabien@symfony.com" 248 | } 249 | ], 250 | "description": "Pimple, a simple Dependency Injection Container", 251 | "homepage": "http://pimple.sensiolabs.org", 252 | "keywords": [ 253 | "container", 254 | "dependency injection" 255 | ], 256 | "time": "2015-09-11 15:10:35" 257 | }, 258 | { 259 | "name": "psr/http-message", 260 | "version": "1.0.1", 261 | "source": { 262 | "type": "git", 263 | "url": "https://github.com/php-fig/http-message.git", 264 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" 265 | }, 266 | "dist": { 267 | "type": "zip", 268 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 269 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 270 | "shasum": "", 271 | "mirrors": [ 272 | { 273 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 274 | "preferred": true 275 | } 276 | ] 277 | }, 278 | "require": { 279 | "php": ">=5.3.0" 280 | }, 281 | "type": "library", 282 | "extra": { 283 | "branch-alias": { 284 | "dev-master": "1.0.x-dev" 285 | } 286 | }, 287 | "autoload": { 288 | "psr-4": { 289 | "Psr\\Http\\Message\\": "src/" 290 | } 291 | }, 292 | "notification-url": "https://packagist.org/downloads/", 293 | "license": [ 294 | "MIT" 295 | ], 296 | "authors": [ 297 | { 298 | "name": "PHP-FIG", 299 | "homepage": "http://www.php-fig.org/" 300 | } 301 | ], 302 | "description": "Common interface for HTTP messages", 303 | "homepage": "https://github.com/php-fig/http-message", 304 | "keywords": [ 305 | "http", 306 | "http-message", 307 | "psr", 308 | "psr-7", 309 | "request", 310 | "response" 311 | ], 312 | "time": "2016-08-06 14:39:51" 313 | } 314 | ], 315 | "packages-dev": [ 316 | { 317 | "name": "doctrine/instantiator", 318 | "version": "1.0.5", 319 | "source": { 320 | "type": "git", 321 | "url": "https://github.com/doctrine/instantiator.git", 322 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" 323 | }, 324 | "dist": { 325 | "type": "zip", 326 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", 327 | "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", 328 | "shasum": "", 329 | "mirrors": [ 330 | { 331 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 332 | "preferred": true 333 | } 334 | ] 335 | }, 336 | "require": { 337 | "php": ">=5.3,<8.0-DEV" 338 | }, 339 | "require-dev": { 340 | "athletic/athletic": "~0.1.8", 341 | "ext-pdo": "*", 342 | "ext-phar": "*", 343 | "phpunit/phpunit": "~4.0", 344 | "squizlabs/php_codesniffer": "~2.0" 345 | }, 346 | "type": "library", 347 | "extra": { 348 | "branch-alias": { 349 | "dev-master": "1.0.x-dev" 350 | } 351 | }, 352 | "autoload": { 353 | "psr-4": { 354 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 355 | } 356 | }, 357 | "notification-url": "https://packagist.org/downloads/", 358 | "license": [ 359 | "MIT" 360 | ], 361 | "authors": [ 362 | { 363 | "name": "Marco Pivetta", 364 | "email": "ocramius@gmail.com", 365 | "homepage": "http://ocramius.github.com/" 366 | } 367 | ], 368 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 369 | "homepage": "https://github.com/doctrine/instantiator", 370 | "keywords": [ 371 | "constructor", 372 | "instantiate" 373 | ], 374 | "time": "2015-06-14 21:17:01" 375 | }, 376 | { 377 | "name": "myclabs/deep-copy", 378 | "version": "1.6.0", 379 | "source": { 380 | "type": "git", 381 | "url": "https://github.com/myclabs/DeepCopy.git", 382 | "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" 383 | }, 384 | "dist": { 385 | "type": "zip", 386 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", 387 | "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", 388 | "shasum": "", 389 | "mirrors": [ 390 | { 391 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 392 | "preferred": true 393 | } 394 | ] 395 | }, 396 | "require": { 397 | "php": ">=5.4.0" 398 | }, 399 | "require-dev": { 400 | "doctrine/collections": "1.*", 401 | "phpunit/phpunit": "~4.1" 402 | }, 403 | "type": "library", 404 | "autoload": { 405 | "psr-4": { 406 | "DeepCopy\\": "src/DeepCopy/" 407 | } 408 | }, 409 | "notification-url": "https://packagist.org/downloads/", 410 | "license": [ 411 | "MIT" 412 | ], 413 | "description": "Create deep copies (clones) of your objects", 414 | "homepage": "https://github.com/myclabs/DeepCopy", 415 | "keywords": [ 416 | "clone", 417 | "copy", 418 | "duplicate", 419 | "object", 420 | "object graph" 421 | ], 422 | "time": "2017-01-26 22:05:40" 423 | }, 424 | { 425 | "name": "phar-io/manifest", 426 | "version": "1.0.1", 427 | "source": { 428 | "type": "git", 429 | "url": "https://github.com/phar-io/manifest.git", 430 | "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" 431 | }, 432 | "dist": { 433 | "type": "zip", 434 | "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", 435 | "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", 436 | "shasum": "", 437 | "mirrors": [ 438 | { 439 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 440 | "preferred": true 441 | } 442 | ] 443 | }, 444 | "require": { 445 | "ext-dom": "*", 446 | "ext-phar": "*", 447 | "phar-io/version": "^1.0.1", 448 | "php": "^5.6 || ^7.0" 449 | }, 450 | "type": "library", 451 | "extra": { 452 | "branch-alias": { 453 | "dev-master": "1.0.x-dev" 454 | } 455 | }, 456 | "autoload": { 457 | "classmap": [ 458 | "src/" 459 | ] 460 | }, 461 | "notification-url": "https://packagist.org/downloads/", 462 | "license": [ 463 | "BSD-3-Clause" 464 | ], 465 | "authors": [ 466 | { 467 | "name": "Arne Blankerts", 468 | "email": "arne@blankerts.de", 469 | "role": "Developer" 470 | }, 471 | { 472 | "name": "Sebastian Heuer", 473 | "email": "sebastian@phpeople.de", 474 | "role": "Developer" 475 | }, 476 | { 477 | "name": "Sebastian Bergmann", 478 | "email": "sebastian@phpunit.de", 479 | "role": "Developer" 480 | } 481 | ], 482 | "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", 483 | "time": "2017-03-05 18:14:27" 484 | }, 485 | { 486 | "name": "phar-io/version", 487 | "version": "1.0.1", 488 | "source": { 489 | "type": "git", 490 | "url": "https://github.com/phar-io/version.git", 491 | "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" 492 | }, 493 | "dist": { 494 | "type": "zip", 495 | "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", 496 | "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", 497 | "shasum": "", 498 | "mirrors": [ 499 | { 500 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 501 | "preferred": true 502 | } 503 | ] 504 | }, 505 | "require": { 506 | "php": "^5.6 || ^7.0" 507 | }, 508 | "type": "library", 509 | "autoload": { 510 | "classmap": [ 511 | "src/" 512 | ] 513 | }, 514 | "notification-url": "https://packagist.org/downloads/", 515 | "license": [ 516 | "BSD-3-Clause" 517 | ], 518 | "authors": [ 519 | { 520 | "name": "Arne Blankerts", 521 | "email": "arne@blankerts.de", 522 | "role": "Developer" 523 | }, 524 | { 525 | "name": "Sebastian Heuer", 526 | "email": "sebastian@phpeople.de", 527 | "role": "Developer" 528 | }, 529 | { 530 | "name": "Sebastian Bergmann", 531 | "email": "sebastian@phpunit.de", 532 | "role": "Developer" 533 | } 534 | ], 535 | "description": "Library for handling version information and constraints", 536 | "time": "2017-03-05 17:38:23" 537 | }, 538 | { 539 | "name": "phpdocumentor/reflection-common", 540 | "version": "1.0", 541 | "source": { 542 | "type": "git", 543 | "url": "https://github.com/phpDocumentor/ReflectionCommon.git", 544 | "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" 545 | }, 546 | "dist": { 547 | "type": "zip", 548 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", 549 | "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", 550 | "shasum": "", 551 | "mirrors": [ 552 | { 553 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 554 | "preferred": true 555 | } 556 | ] 557 | }, 558 | "require": { 559 | "php": ">=5.5" 560 | }, 561 | "require-dev": { 562 | "phpunit/phpunit": "^4.6" 563 | }, 564 | "type": "library", 565 | "extra": { 566 | "branch-alias": { 567 | "dev-master": "1.0.x-dev" 568 | } 569 | }, 570 | "autoload": { 571 | "psr-4": { 572 | "phpDocumentor\\Reflection\\": [ 573 | "src" 574 | ] 575 | } 576 | }, 577 | "notification-url": "https://packagist.org/downloads/", 578 | "license": [ 579 | "MIT" 580 | ], 581 | "authors": [ 582 | { 583 | "name": "Jaap van Otterdijk", 584 | "email": "opensource@ijaap.nl" 585 | } 586 | ], 587 | "description": "Common reflection classes used by phpdocumentor to reflect the code structure", 588 | "homepage": "http://www.phpdoc.org", 589 | "keywords": [ 590 | "FQSEN", 591 | "phpDocumentor", 592 | "phpdoc", 593 | "reflection", 594 | "static analysis" 595 | ], 596 | "time": "2015-12-27 11:43:31" 597 | }, 598 | { 599 | "name": "phpdocumentor/reflection-docblock", 600 | "version": "3.1.1", 601 | "source": { 602 | "type": "git", 603 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 604 | "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" 605 | }, 606 | "dist": { 607 | "type": "zip", 608 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", 609 | "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", 610 | "shasum": "", 611 | "mirrors": [ 612 | { 613 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 614 | "preferred": true 615 | } 616 | ] 617 | }, 618 | "require": { 619 | "php": ">=5.5", 620 | "phpdocumentor/reflection-common": "^1.0@dev", 621 | "phpdocumentor/type-resolver": "^0.2.0", 622 | "webmozart/assert": "^1.0" 623 | }, 624 | "require-dev": { 625 | "mockery/mockery": "^0.9.4", 626 | "phpunit/phpunit": "^4.4" 627 | }, 628 | "type": "library", 629 | "autoload": { 630 | "psr-4": { 631 | "phpDocumentor\\Reflection\\": [ 632 | "src/" 633 | ] 634 | } 635 | }, 636 | "notification-url": "https://packagist.org/downloads/", 637 | "license": [ 638 | "MIT" 639 | ], 640 | "authors": [ 641 | { 642 | "name": "Mike van Riel", 643 | "email": "me@mikevanriel.com" 644 | } 645 | ], 646 | "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", 647 | "time": "2016-09-30 07:12:33" 648 | }, 649 | { 650 | "name": "phpdocumentor/type-resolver", 651 | "version": "0.2.1", 652 | "source": { 653 | "type": "git", 654 | "url": "https://github.com/phpDocumentor/TypeResolver.git", 655 | "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" 656 | }, 657 | "dist": { 658 | "type": "zip", 659 | "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", 660 | "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", 661 | "shasum": "", 662 | "mirrors": [ 663 | { 664 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 665 | "preferred": true 666 | } 667 | ] 668 | }, 669 | "require": { 670 | "php": ">=5.5", 671 | "phpdocumentor/reflection-common": "^1.0" 672 | }, 673 | "require-dev": { 674 | "mockery/mockery": "^0.9.4", 675 | "phpunit/phpunit": "^5.2||^4.8.24" 676 | }, 677 | "type": "library", 678 | "extra": { 679 | "branch-alias": { 680 | "dev-master": "1.0.x-dev" 681 | } 682 | }, 683 | "autoload": { 684 | "psr-4": { 685 | "phpDocumentor\\Reflection\\": [ 686 | "src/" 687 | ] 688 | } 689 | }, 690 | "notification-url": "https://packagist.org/downloads/", 691 | "license": [ 692 | "MIT" 693 | ], 694 | "authors": [ 695 | { 696 | "name": "Mike van Riel", 697 | "email": "me@mikevanriel.com" 698 | } 699 | ], 700 | "time": "2016-11-25 06:54:22" 701 | }, 702 | { 703 | "name": "phpspec/prophecy", 704 | "version": "v1.7.0", 705 | "source": { 706 | "type": "git", 707 | "url": "https://github.com/phpspec/prophecy.git", 708 | "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" 709 | }, 710 | "dist": { 711 | "type": "zip", 712 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", 713 | "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", 714 | "shasum": "", 715 | "mirrors": [ 716 | { 717 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 718 | "preferred": true 719 | } 720 | ] 721 | }, 722 | "require": { 723 | "doctrine/instantiator": "^1.0.2", 724 | "php": "^5.3|^7.0", 725 | "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", 726 | "sebastian/comparator": "^1.1|^2.0", 727 | "sebastian/recursion-context": "^1.0|^2.0|^3.0" 728 | }, 729 | "require-dev": { 730 | "phpspec/phpspec": "^2.5|^3.2", 731 | "phpunit/phpunit": "^4.8 || ^5.6.5" 732 | }, 733 | "type": "library", 734 | "extra": { 735 | "branch-alias": { 736 | "dev-master": "1.6.x-dev" 737 | } 738 | }, 739 | "autoload": { 740 | "psr-0": { 741 | "Prophecy\\": "src/" 742 | } 743 | }, 744 | "notification-url": "https://packagist.org/downloads/", 745 | "license": [ 746 | "MIT" 747 | ], 748 | "authors": [ 749 | { 750 | "name": "Konstantin Kudryashov", 751 | "email": "ever.zet@gmail.com", 752 | "homepage": "http://everzet.com" 753 | }, 754 | { 755 | "name": "Marcello Duarte", 756 | "email": "marcello.duarte@gmail.com" 757 | } 758 | ], 759 | "description": "Highly opinionated mocking framework for PHP 5.3+", 760 | "homepage": "https://github.com/phpspec/prophecy", 761 | "keywords": [ 762 | "Double", 763 | "Dummy", 764 | "fake", 765 | "mock", 766 | "spy", 767 | "stub" 768 | ], 769 | "time": "2017-03-02 20:05:34" 770 | }, 771 | { 772 | "name": "phpunit/php-code-coverage", 773 | "version": "5.1.0", 774 | "source": { 775 | "type": "git", 776 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 777 | "reference": "cff36444733ac6d3f153866f55898373ca184610" 778 | }, 779 | "dist": { 780 | "type": "zip", 781 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/cff36444733ac6d3f153866f55898373ca184610", 782 | "reference": "cff36444733ac6d3f153866f55898373ca184610", 783 | "shasum": "", 784 | "mirrors": [ 785 | { 786 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 787 | "preferred": true 788 | } 789 | ] 790 | }, 791 | "require": { 792 | "ext-dom": "*", 793 | "ext-xmlwriter": "*", 794 | "php": "^7.0", 795 | "phpunit/php-file-iterator": "^1.3", 796 | "phpunit/php-text-template": "^1.2", 797 | "phpunit/php-token-stream": "^1.4.11 || ^2.0", 798 | "sebastian/code-unit-reverse-lookup": "^1.0", 799 | "sebastian/environment": "^2.0", 800 | "sebastian/version": "^2.0" 801 | }, 802 | "require-dev": { 803 | "ext-xdebug": "^2.5", 804 | "phpunit/phpunit": "^6.0" 805 | }, 806 | "suggest": { 807 | "ext-xdebug": "^2.5.1" 808 | }, 809 | "type": "library", 810 | "extra": { 811 | "branch-alias": { 812 | "dev-master": "5.1.x-dev" 813 | } 814 | }, 815 | "autoload": { 816 | "classmap": [ 817 | "src/" 818 | ] 819 | }, 820 | "notification-url": "https://packagist.org/downloads/", 821 | "license": [ 822 | "BSD-3-Clause" 823 | ], 824 | "authors": [ 825 | { 826 | "name": "Sebastian Bergmann", 827 | "email": "sb@sebastian-bergmann.de", 828 | "role": "lead" 829 | } 830 | ], 831 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 832 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 833 | "keywords": [ 834 | "coverage", 835 | "testing", 836 | "xunit" 837 | ], 838 | "time": "2017-04-07 04:39:58" 839 | }, 840 | { 841 | "name": "phpunit/php-file-iterator", 842 | "version": "1.4.2", 843 | "source": { 844 | "type": "git", 845 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 846 | "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" 847 | }, 848 | "dist": { 849 | "type": "zip", 850 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", 851 | "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", 852 | "shasum": "", 853 | "mirrors": [ 854 | { 855 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 856 | "preferred": true 857 | } 858 | ] 859 | }, 860 | "require": { 861 | "php": ">=5.3.3" 862 | }, 863 | "type": "library", 864 | "extra": { 865 | "branch-alias": { 866 | "dev-master": "1.4.x-dev" 867 | } 868 | }, 869 | "autoload": { 870 | "classmap": [ 871 | "src/" 872 | ] 873 | }, 874 | "notification-url": "https://packagist.org/downloads/", 875 | "license": [ 876 | "BSD-3-Clause" 877 | ], 878 | "authors": [ 879 | { 880 | "name": "Sebastian Bergmann", 881 | "email": "sb@sebastian-bergmann.de", 882 | "role": "lead" 883 | } 884 | ], 885 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 886 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 887 | "keywords": [ 888 | "filesystem", 889 | "iterator" 890 | ], 891 | "time": "2016-10-03 07:40:28" 892 | }, 893 | { 894 | "name": "phpunit/php-text-template", 895 | "version": "1.2.1", 896 | "source": { 897 | "type": "git", 898 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 899 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" 900 | }, 901 | "dist": { 902 | "type": "zip", 903 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 904 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 905 | "shasum": "", 906 | "mirrors": [ 907 | { 908 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 909 | "preferred": true 910 | } 911 | ] 912 | }, 913 | "require": { 914 | "php": ">=5.3.3" 915 | }, 916 | "type": "library", 917 | "autoload": { 918 | "classmap": [ 919 | "src/" 920 | ] 921 | }, 922 | "notification-url": "https://packagist.org/downloads/", 923 | "license": [ 924 | "BSD-3-Clause" 925 | ], 926 | "authors": [ 927 | { 928 | "name": "Sebastian Bergmann", 929 | "email": "sebastian@phpunit.de", 930 | "role": "lead" 931 | } 932 | ], 933 | "description": "Simple template engine.", 934 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 935 | "keywords": [ 936 | "template" 937 | ], 938 | "time": "2015-06-21 13:50:34" 939 | }, 940 | { 941 | "name": "phpunit/php-timer", 942 | "version": "1.0.9", 943 | "source": { 944 | "type": "git", 945 | "url": "https://github.com/sebastianbergmann/php-timer.git", 946 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" 947 | }, 948 | "dist": { 949 | "type": "zip", 950 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", 951 | "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", 952 | "shasum": "", 953 | "mirrors": [ 954 | { 955 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 956 | "preferred": true 957 | } 958 | ] 959 | }, 960 | "require": { 961 | "php": "^5.3.3 || ^7.0" 962 | }, 963 | "require-dev": { 964 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" 965 | }, 966 | "type": "library", 967 | "extra": { 968 | "branch-alias": { 969 | "dev-master": "1.0-dev" 970 | } 971 | }, 972 | "autoload": { 973 | "classmap": [ 974 | "src/" 975 | ] 976 | }, 977 | "notification-url": "https://packagist.org/downloads/", 978 | "license": [ 979 | "BSD-3-Clause" 980 | ], 981 | "authors": [ 982 | { 983 | "name": "Sebastian Bergmann", 984 | "email": "sb@sebastian-bergmann.de", 985 | "role": "lead" 986 | } 987 | ], 988 | "description": "Utility class for timing", 989 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 990 | "keywords": [ 991 | "timer" 992 | ], 993 | "time": "2017-02-26 11:10:40" 994 | }, 995 | { 996 | "name": "phpunit/php-token-stream", 997 | "version": "1.4.11", 998 | "source": { 999 | "type": "git", 1000 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 1001 | "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" 1002 | }, 1003 | "dist": { 1004 | "type": "zip", 1005 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", 1006 | "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", 1007 | "shasum": "", 1008 | "mirrors": [ 1009 | { 1010 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1011 | "preferred": true 1012 | } 1013 | ] 1014 | }, 1015 | "require": { 1016 | "ext-tokenizer": "*", 1017 | "php": ">=5.3.3" 1018 | }, 1019 | "require-dev": { 1020 | "phpunit/phpunit": "~4.2" 1021 | }, 1022 | "type": "library", 1023 | "extra": { 1024 | "branch-alias": { 1025 | "dev-master": "1.4-dev" 1026 | } 1027 | }, 1028 | "autoload": { 1029 | "classmap": [ 1030 | "src/" 1031 | ] 1032 | }, 1033 | "notification-url": "https://packagist.org/downloads/", 1034 | "license": [ 1035 | "BSD-3-Clause" 1036 | ], 1037 | "authors": [ 1038 | { 1039 | "name": "Sebastian Bergmann", 1040 | "email": "sebastian@phpunit.de" 1041 | } 1042 | ], 1043 | "description": "Wrapper around PHP's tokenizer extension.", 1044 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 1045 | "keywords": [ 1046 | "tokenizer" 1047 | ], 1048 | "time": "2017-02-27 10:12:30" 1049 | }, 1050 | { 1051 | "name": "phpunit/phpunit", 1052 | "version": "6.1.0", 1053 | "source": { 1054 | "type": "git", 1055 | "url": "https://github.com/sebastianbergmann/phpunit.git", 1056 | "reference": "2aa57c530381662b01c2cf705b03e8c12e918f1d" 1057 | }, 1058 | "dist": { 1059 | "type": "zip", 1060 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2aa57c530381662b01c2cf705b03e8c12e918f1d", 1061 | "reference": "2aa57c530381662b01c2cf705b03e8c12e918f1d", 1062 | "shasum": "", 1063 | "mirrors": [ 1064 | { 1065 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1066 | "preferred": true 1067 | } 1068 | ] 1069 | }, 1070 | "require": { 1071 | "ext-dom": "*", 1072 | "ext-json": "*", 1073 | "ext-libxml": "*", 1074 | "ext-mbstring": "*", 1075 | "ext-xml": "*", 1076 | "myclabs/deep-copy": "^1.3", 1077 | "phar-io/manifest": "^1.0.1", 1078 | "phar-io/version": "^1.0", 1079 | "php": "^7.0", 1080 | "phpspec/prophecy": "^1.7", 1081 | "phpunit/php-code-coverage": "^5.0", 1082 | "phpunit/php-file-iterator": "^1.4", 1083 | "phpunit/php-text-template": "^1.2", 1084 | "phpunit/php-timer": "^1.0.6", 1085 | "phpunit/phpunit-mock-objects": "^4.0", 1086 | "sebastian/comparator": "^2.0", 1087 | "sebastian/diff": "^1.2", 1088 | "sebastian/environment": "^2.0", 1089 | "sebastian/exporter": "^3.1", 1090 | "sebastian/global-state": "^1.1 || ^2.0", 1091 | "sebastian/object-enumerator": "^3.0.2", 1092 | "sebastian/resource-operations": "^1.0", 1093 | "sebastian/version": "^2.0" 1094 | }, 1095 | "conflict": { 1096 | "phpdocumentor/reflection-docblock": "3.0.2", 1097 | "phpunit/dbunit": "<3.0" 1098 | }, 1099 | "require-dev": { 1100 | "ext-pdo": "*" 1101 | }, 1102 | "suggest": { 1103 | "ext-xdebug": "*", 1104 | "phpunit/php-invoker": "^1.1" 1105 | }, 1106 | "bin": [ 1107 | "phpunit" 1108 | ], 1109 | "type": "library", 1110 | "extra": { 1111 | "branch-alias": { 1112 | "dev-master": "6.1.x-dev" 1113 | } 1114 | }, 1115 | "autoload": { 1116 | "classmap": [ 1117 | "src/" 1118 | ] 1119 | }, 1120 | "notification-url": "https://packagist.org/downloads/", 1121 | "license": [ 1122 | "BSD-3-Clause" 1123 | ], 1124 | "authors": [ 1125 | { 1126 | "name": "Sebastian Bergmann", 1127 | "email": "sebastian@phpunit.de", 1128 | "role": "lead" 1129 | } 1130 | ], 1131 | "description": "The PHP Unit Testing framework.", 1132 | "homepage": "https://phpunit.de/", 1133 | "keywords": [ 1134 | "phpunit", 1135 | "testing", 1136 | "xunit" 1137 | ], 1138 | "time": "2017-04-07 04:45:38" 1139 | }, 1140 | { 1141 | "name": "phpunit/phpunit-mock-objects", 1142 | "version": "4.0.1", 1143 | "source": { 1144 | "type": "git", 1145 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", 1146 | "reference": "eabce450df194817a7d7e27e19013569a903a2bf" 1147 | }, 1148 | "dist": { 1149 | "type": "zip", 1150 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/eabce450df194817a7d7e27e19013569a903a2bf", 1151 | "reference": "eabce450df194817a7d7e27e19013569a903a2bf", 1152 | "shasum": "", 1153 | "mirrors": [ 1154 | { 1155 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1156 | "preferred": true 1157 | } 1158 | ] 1159 | }, 1160 | "require": { 1161 | "doctrine/instantiator": "^1.0.2", 1162 | "php": "^7.0", 1163 | "phpunit/php-text-template": "^1.2", 1164 | "sebastian/exporter": "^3.0" 1165 | }, 1166 | "conflict": { 1167 | "phpunit/phpunit": "<6.0" 1168 | }, 1169 | "require-dev": { 1170 | "phpunit/phpunit": "^6.0" 1171 | }, 1172 | "suggest": { 1173 | "ext-soap": "*" 1174 | }, 1175 | "type": "library", 1176 | "extra": { 1177 | "branch-alias": { 1178 | "dev-master": "4.0.x-dev" 1179 | } 1180 | }, 1181 | "autoload": { 1182 | "classmap": [ 1183 | "src/" 1184 | ] 1185 | }, 1186 | "notification-url": "https://packagist.org/downloads/", 1187 | "license": [ 1188 | "BSD-3-Clause" 1189 | ], 1190 | "authors": [ 1191 | { 1192 | "name": "Sebastian Bergmann", 1193 | "email": "sb@sebastian-bergmann.de", 1194 | "role": "lead" 1195 | } 1196 | ], 1197 | "description": "Mock Object library for PHPUnit", 1198 | "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", 1199 | "keywords": [ 1200 | "mock", 1201 | "xunit" 1202 | ], 1203 | "time": "2017-03-03 06:30:20" 1204 | }, 1205 | { 1206 | "name": "sebastian/code-unit-reverse-lookup", 1207 | "version": "1.0.1", 1208 | "source": { 1209 | "type": "git", 1210 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", 1211 | "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" 1212 | }, 1213 | "dist": { 1214 | "type": "zip", 1215 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", 1216 | "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", 1217 | "shasum": "", 1218 | "mirrors": [ 1219 | { 1220 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1221 | "preferred": true 1222 | } 1223 | ] 1224 | }, 1225 | "require": { 1226 | "php": "^5.6 || ^7.0" 1227 | }, 1228 | "require-dev": { 1229 | "phpunit/phpunit": "^5.7 || ^6.0" 1230 | }, 1231 | "type": "library", 1232 | "extra": { 1233 | "branch-alias": { 1234 | "dev-master": "1.0.x-dev" 1235 | } 1236 | }, 1237 | "autoload": { 1238 | "classmap": [ 1239 | "src/" 1240 | ] 1241 | }, 1242 | "notification-url": "https://packagist.org/downloads/", 1243 | "license": [ 1244 | "BSD-3-Clause" 1245 | ], 1246 | "authors": [ 1247 | { 1248 | "name": "Sebastian Bergmann", 1249 | "email": "sebastian@phpunit.de" 1250 | } 1251 | ], 1252 | "description": "Looks up which function or method a line of code belongs to", 1253 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", 1254 | "time": "2017-03-04 06:30:41" 1255 | }, 1256 | { 1257 | "name": "sebastian/comparator", 1258 | "version": "2.0.0", 1259 | "source": { 1260 | "type": "git", 1261 | "url": "https://github.com/sebastianbergmann/comparator.git", 1262 | "reference": "20f84f468cb67efee293246e6a09619b891f55f0" 1263 | }, 1264 | "dist": { 1265 | "type": "zip", 1266 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/20f84f468cb67efee293246e6a09619b891f55f0", 1267 | "reference": "20f84f468cb67efee293246e6a09619b891f55f0", 1268 | "shasum": "", 1269 | "mirrors": [ 1270 | { 1271 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1272 | "preferred": true 1273 | } 1274 | ] 1275 | }, 1276 | "require": { 1277 | "php": "^7.0", 1278 | "sebastian/diff": "^1.2", 1279 | "sebastian/exporter": "^3.0" 1280 | }, 1281 | "require-dev": { 1282 | "phpunit/phpunit": "^6.0" 1283 | }, 1284 | "type": "library", 1285 | "extra": { 1286 | "branch-alias": { 1287 | "dev-master": "2.0.x-dev" 1288 | } 1289 | }, 1290 | "autoload": { 1291 | "classmap": [ 1292 | "src/" 1293 | ] 1294 | }, 1295 | "notification-url": "https://packagist.org/downloads/", 1296 | "license": [ 1297 | "BSD-3-Clause" 1298 | ], 1299 | "authors": [ 1300 | { 1301 | "name": "Jeff Welch", 1302 | "email": "whatthejeff@gmail.com" 1303 | }, 1304 | { 1305 | "name": "Volker Dusch", 1306 | "email": "github@wallbash.com" 1307 | }, 1308 | { 1309 | "name": "Bernhard Schussek", 1310 | "email": "bschussek@2bepublished.at" 1311 | }, 1312 | { 1313 | "name": "Sebastian Bergmann", 1314 | "email": "sebastian@phpunit.de" 1315 | } 1316 | ], 1317 | "description": "Provides the functionality to compare PHP values for equality", 1318 | "homepage": "http://www.github.com/sebastianbergmann/comparator", 1319 | "keywords": [ 1320 | "comparator", 1321 | "compare", 1322 | "equality" 1323 | ], 1324 | "time": "2017-03-03 06:26:08" 1325 | }, 1326 | { 1327 | "name": "sebastian/diff", 1328 | "version": "1.4.1", 1329 | "source": { 1330 | "type": "git", 1331 | "url": "https://github.com/sebastianbergmann/diff.git", 1332 | "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" 1333 | }, 1334 | "dist": { 1335 | "type": "zip", 1336 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", 1337 | "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", 1338 | "shasum": "", 1339 | "mirrors": [ 1340 | { 1341 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1342 | "preferred": true 1343 | } 1344 | ] 1345 | }, 1346 | "require": { 1347 | "php": ">=5.3.3" 1348 | }, 1349 | "require-dev": { 1350 | "phpunit/phpunit": "~4.8" 1351 | }, 1352 | "type": "library", 1353 | "extra": { 1354 | "branch-alias": { 1355 | "dev-master": "1.4-dev" 1356 | } 1357 | }, 1358 | "autoload": { 1359 | "classmap": [ 1360 | "src/" 1361 | ] 1362 | }, 1363 | "notification-url": "https://packagist.org/downloads/", 1364 | "license": [ 1365 | "BSD-3-Clause" 1366 | ], 1367 | "authors": [ 1368 | { 1369 | "name": "Kore Nordmann", 1370 | "email": "mail@kore-nordmann.de" 1371 | }, 1372 | { 1373 | "name": "Sebastian Bergmann", 1374 | "email": "sebastian@phpunit.de" 1375 | } 1376 | ], 1377 | "description": "Diff implementation", 1378 | "homepage": "https://github.com/sebastianbergmann/diff", 1379 | "keywords": [ 1380 | "diff" 1381 | ], 1382 | "time": "2015-12-08 07:14:41" 1383 | }, 1384 | { 1385 | "name": "sebastian/environment", 1386 | "version": "2.0.0", 1387 | "source": { 1388 | "type": "git", 1389 | "url": "https://github.com/sebastianbergmann/environment.git", 1390 | "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" 1391 | }, 1392 | "dist": { 1393 | "type": "zip", 1394 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", 1395 | "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", 1396 | "shasum": "", 1397 | "mirrors": [ 1398 | { 1399 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1400 | "preferred": true 1401 | } 1402 | ] 1403 | }, 1404 | "require": { 1405 | "php": "^5.6 || ^7.0" 1406 | }, 1407 | "require-dev": { 1408 | "phpunit/phpunit": "^5.0" 1409 | }, 1410 | "type": "library", 1411 | "extra": { 1412 | "branch-alias": { 1413 | "dev-master": "2.0.x-dev" 1414 | } 1415 | }, 1416 | "autoload": { 1417 | "classmap": [ 1418 | "src/" 1419 | ] 1420 | }, 1421 | "notification-url": "https://packagist.org/downloads/", 1422 | "license": [ 1423 | "BSD-3-Clause" 1424 | ], 1425 | "authors": [ 1426 | { 1427 | "name": "Sebastian Bergmann", 1428 | "email": "sebastian@phpunit.de" 1429 | } 1430 | ], 1431 | "description": "Provides functionality to handle HHVM/PHP environments", 1432 | "homepage": "http://www.github.com/sebastianbergmann/environment", 1433 | "keywords": [ 1434 | "Xdebug", 1435 | "environment", 1436 | "hhvm" 1437 | ], 1438 | "time": "2016-11-26 07:53:53" 1439 | }, 1440 | { 1441 | "name": "sebastian/exporter", 1442 | "version": "3.1.0", 1443 | "source": { 1444 | "type": "git", 1445 | "url": "https://github.com/sebastianbergmann/exporter.git", 1446 | "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" 1447 | }, 1448 | "dist": { 1449 | "type": "zip", 1450 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", 1451 | "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", 1452 | "shasum": "", 1453 | "mirrors": [ 1454 | { 1455 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1456 | "preferred": true 1457 | } 1458 | ] 1459 | }, 1460 | "require": { 1461 | "php": "^7.0", 1462 | "sebastian/recursion-context": "^3.0" 1463 | }, 1464 | "require-dev": { 1465 | "ext-mbstring": "*", 1466 | "phpunit/phpunit": "^6.0" 1467 | }, 1468 | "type": "library", 1469 | "extra": { 1470 | "branch-alias": { 1471 | "dev-master": "3.1.x-dev" 1472 | } 1473 | }, 1474 | "autoload": { 1475 | "classmap": [ 1476 | "src/" 1477 | ] 1478 | }, 1479 | "notification-url": "https://packagist.org/downloads/", 1480 | "license": [ 1481 | "BSD-3-Clause" 1482 | ], 1483 | "authors": [ 1484 | { 1485 | "name": "Jeff Welch", 1486 | "email": "whatthejeff@gmail.com" 1487 | }, 1488 | { 1489 | "name": "Volker Dusch", 1490 | "email": "github@wallbash.com" 1491 | }, 1492 | { 1493 | "name": "Bernhard Schussek", 1494 | "email": "bschussek@2bepublished.at" 1495 | }, 1496 | { 1497 | "name": "Sebastian Bergmann", 1498 | "email": "sebastian@phpunit.de" 1499 | }, 1500 | { 1501 | "name": "Adam Harvey", 1502 | "email": "aharvey@php.net" 1503 | } 1504 | ], 1505 | "description": "Provides the functionality to export PHP variables for visualization", 1506 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 1507 | "keywords": [ 1508 | "export", 1509 | "exporter" 1510 | ], 1511 | "time": "2017-04-03 13:19:02" 1512 | }, 1513 | { 1514 | "name": "sebastian/global-state", 1515 | "version": "1.1.1", 1516 | "source": { 1517 | "type": "git", 1518 | "url": "https://github.com/sebastianbergmann/global-state.git", 1519 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" 1520 | }, 1521 | "dist": { 1522 | "type": "zip", 1523 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", 1524 | "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", 1525 | "shasum": "", 1526 | "mirrors": [ 1527 | { 1528 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1529 | "preferred": true 1530 | } 1531 | ] 1532 | }, 1533 | "require": { 1534 | "php": ">=5.3.3" 1535 | }, 1536 | "require-dev": { 1537 | "phpunit/phpunit": "~4.2" 1538 | }, 1539 | "suggest": { 1540 | "ext-uopz": "*" 1541 | }, 1542 | "type": "library", 1543 | "extra": { 1544 | "branch-alias": { 1545 | "dev-master": "1.0-dev" 1546 | } 1547 | }, 1548 | "autoload": { 1549 | "classmap": [ 1550 | "src/" 1551 | ] 1552 | }, 1553 | "notification-url": "https://packagist.org/downloads/", 1554 | "license": [ 1555 | "BSD-3-Clause" 1556 | ], 1557 | "authors": [ 1558 | { 1559 | "name": "Sebastian Bergmann", 1560 | "email": "sebastian@phpunit.de" 1561 | } 1562 | ], 1563 | "description": "Snapshotting of global state", 1564 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1565 | "keywords": [ 1566 | "global state" 1567 | ], 1568 | "time": "2015-10-12 03:26:01" 1569 | }, 1570 | { 1571 | "name": "sebastian/object-enumerator", 1572 | "version": "3.0.2", 1573 | "source": { 1574 | "type": "git", 1575 | "url": "https://github.com/sebastianbergmann/object-enumerator.git", 1576 | "reference": "31dd3379d16446c5d86dec32ab1ad1f378581ad8" 1577 | }, 1578 | "dist": { 1579 | "type": "zip", 1580 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/31dd3379d16446c5d86dec32ab1ad1f378581ad8", 1581 | "reference": "31dd3379d16446c5d86dec32ab1ad1f378581ad8", 1582 | "shasum": "", 1583 | "mirrors": [ 1584 | { 1585 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1586 | "preferred": true 1587 | } 1588 | ] 1589 | }, 1590 | "require": { 1591 | "php": "^7.0", 1592 | "sebastian/object-reflector": "^1.0", 1593 | "sebastian/recursion-context": "^3.0" 1594 | }, 1595 | "require-dev": { 1596 | "phpunit/phpunit": "^6.0" 1597 | }, 1598 | "type": "library", 1599 | "extra": { 1600 | "branch-alias": { 1601 | "dev-master": "3.0.x-dev" 1602 | } 1603 | }, 1604 | "autoload": { 1605 | "classmap": [ 1606 | "src/" 1607 | ] 1608 | }, 1609 | "notification-url": "https://packagist.org/downloads/", 1610 | "license": [ 1611 | "BSD-3-Clause" 1612 | ], 1613 | "authors": [ 1614 | { 1615 | "name": "Sebastian Bergmann", 1616 | "email": "sebastian@phpunit.de" 1617 | } 1618 | ], 1619 | "description": "Traverses array structures and object graphs to enumerate all referenced objects", 1620 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/", 1621 | "time": "2017-03-12 15:17:29" 1622 | }, 1623 | { 1624 | "name": "sebastian/object-reflector", 1625 | "version": "1.1.1", 1626 | "source": { 1627 | "type": "git", 1628 | "url": "https://github.com/sebastianbergmann/object-reflector.git", 1629 | "reference": "773f97c67f28de00d397be301821b06708fca0be" 1630 | }, 1631 | "dist": { 1632 | "type": "zip", 1633 | "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", 1634 | "reference": "773f97c67f28de00d397be301821b06708fca0be", 1635 | "shasum": "", 1636 | "mirrors": [ 1637 | { 1638 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1639 | "preferred": true 1640 | } 1641 | ] 1642 | }, 1643 | "require": { 1644 | "php": "^7.0" 1645 | }, 1646 | "require-dev": { 1647 | "phpunit/phpunit": "^6.0" 1648 | }, 1649 | "type": "library", 1650 | "extra": { 1651 | "branch-alias": { 1652 | "dev-master": "1.1-dev" 1653 | } 1654 | }, 1655 | "autoload": { 1656 | "classmap": [ 1657 | "src/" 1658 | ] 1659 | }, 1660 | "notification-url": "https://packagist.org/downloads/", 1661 | "license": [ 1662 | "BSD-3-Clause" 1663 | ], 1664 | "authors": [ 1665 | { 1666 | "name": "Sebastian Bergmann", 1667 | "email": "sebastian@phpunit.de" 1668 | } 1669 | ], 1670 | "description": "Allows reflection of object attributes, including inherited and non-public ones", 1671 | "homepage": "https://github.com/sebastianbergmann/object-reflector/", 1672 | "time": "2017-03-29 09:07:27" 1673 | }, 1674 | { 1675 | "name": "sebastian/recursion-context", 1676 | "version": "3.0.0", 1677 | "source": { 1678 | "type": "git", 1679 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1680 | "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" 1681 | }, 1682 | "dist": { 1683 | "type": "zip", 1684 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", 1685 | "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", 1686 | "shasum": "", 1687 | "mirrors": [ 1688 | { 1689 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1690 | "preferred": true 1691 | } 1692 | ] 1693 | }, 1694 | "require": { 1695 | "php": "^7.0" 1696 | }, 1697 | "require-dev": { 1698 | "phpunit/phpunit": "^6.0" 1699 | }, 1700 | "type": "library", 1701 | "extra": { 1702 | "branch-alias": { 1703 | "dev-master": "3.0.x-dev" 1704 | } 1705 | }, 1706 | "autoload": { 1707 | "classmap": [ 1708 | "src/" 1709 | ] 1710 | }, 1711 | "notification-url": "https://packagist.org/downloads/", 1712 | "license": [ 1713 | "BSD-3-Clause" 1714 | ], 1715 | "authors": [ 1716 | { 1717 | "name": "Jeff Welch", 1718 | "email": "whatthejeff@gmail.com" 1719 | }, 1720 | { 1721 | "name": "Sebastian Bergmann", 1722 | "email": "sebastian@phpunit.de" 1723 | }, 1724 | { 1725 | "name": "Adam Harvey", 1726 | "email": "aharvey@php.net" 1727 | } 1728 | ], 1729 | "description": "Provides functionality to recursively process PHP variables", 1730 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 1731 | "time": "2017-03-03 06:23:57" 1732 | }, 1733 | { 1734 | "name": "sebastian/resource-operations", 1735 | "version": "1.0.0", 1736 | "source": { 1737 | "type": "git", 1738 | "url": "https://github.com/sebastianbergmann/resource-operations.git", 1739 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" 1740 | }, 1741 | "dist": { 1742 | "type": "zip", 1743 | "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 1744 | "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", 1745 | "shasum": "", 1746 | "mirrors": [ 1747 | { 1748 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1749 | "preferred": true 1750 | } 1751 | ] 1752 | }, 1753 | "require": { 1754 | "php": ">=5.6.0" 1755 | }, 1756 | "type": "library", 1757 | "extra": { 1758 | "branch-alias": { 1759 | "dev-master": "1.0.x-dev" 1760 | } 1761 | }, 1762 | "autoload": { 1763 | "classmap": [ 1764 | "src/" 1765 | ] 1766 | }, 1767 | "notification-url": "https://packagist.org/downloads/", 1768 | "license": [ 1769 | "BSD-3-Clause" 1770 | ], 1771 | "authors": [ 1772 | { 1773 | "name": "Sebastian Bergmann", 1774 | "email": "sebastian@phpunit.de" 1775 | } 1776 | ], 1777 | "description": "Provides a list of PHP built-in functions that operate on resources", 1778 | "homepage": "https://www.github.com/sebastianbergmann/resource-operations", 1779 | "time": "2015-07-28 20:34:47" 1780 | }, 1781 | { 1782 | "name": "sebastian/version", 1783 | "version": "2.0.1", 1784 | "source": { 1785 | "type": "git", 1786 | "url": "https://github.com/sebastianbergmann/version.git", 1787 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" 1788 | }, 1789 | "dist": { 1790 | "type": "zip", 1791 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", 1792 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", 1793 | "shasum": "", 1794 | "mirrors": [ 1795 | { 1796 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1797 | "preferred": true 1798 | } 1799 | ] 1800 | }, 1801 | "require": { 1802 | "php": ">=5.6" 1803 | }, 1804 | "type": "library", 1805 | "extra": { 1806 | "branch-alias": { 1807 | "dev-master": "2.0.x-dev" 1808 | } 1809 | }, 1810 | "autoload": { 1811 | "classmap": [ 1812 | "src/" 1813 | ] 1814 | }, 1815 | "notification-url": "https://packagist.org/downloads/", 1816 | "license": [ 1817 | "BSD-3-Clause" 1818 | ], 1819 | "authors": [ 1820 | { 1821 | "name": "Sebastian Bergmann", 1822 | "email": "sebastian@phpunit.de", 1823 | "role": "lead" 1824 | } 1825 | ], 1826 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1827 | "homepage": "https://github.com/sebastianbergmann/version", 1828 | "time": "2016-10-03 07:35:21" 1829 | }, 1830 | { 1831 | "name": "webmozart/assert", 1832 | "version": "1.2.0", 1833 | "source": { 1834 | "type": "git", 1835 | "url": "https://github.com/webmozart/assert.git", 1836 | "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" 1837 | }, 1838 | "dist": { 1839 | "type": "zip", 1840 | "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", 1841 | "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", 1842 | "shasum": "", 1843 | "mirrors": [ 1844 | { 1845 | "url": "https://dl.laravel-china.org/%package%/%reference%.%type%", 1846 | "preferred": true 1847 | } 1848 | ] 1849 | }, 1850 | "require": { 1851 | "php": "^5.3.3 || ^7.0" 1852 | }, 1853 | "require-dev": { 1854 | "phpunit/phpunit": "^4.6", 1855 | "sebastian/version": "^1.0.1" 1856 | }, 1857 | "type": "library", 1858 | "extra": { 1859 | "branch-alias": { 1860 | "dev-master": "1.3-dev" 1861 | } 1862 | }, 1863 | "autoload": { 1864 | "psr-4": { 1865 | "Webmozart\\Assert\\": "src/" 1866 | } 1867 | }, 1868 | "notification-url": "https://packagist.org/downloads/", 1869 | "license": [ 1870 | "MIT" 1871 | ], 1872 | "authors": [ 1873 | { 1874 | "name": "Bernhard Schussek", 1875 | "email": "bschussek@gmail.com" 1876 | } 1877 | ], 1878 | "description": "Assertions to validate method input/output with nice error messages.", 1879 | "keywords": [ 1880 | "assert", 1881 | "check", 1882 | "validate" 1883 | ], 1884 | "time": "2016-11-23 20:04:58" 1885 | } 1886 | ], 1887 | "aliases": [], 1888 | "minimum-stability": "stable", 1889 | "stability-flags": [], 1890 | "prefer-stable": false, 1891 | "prefer-lowest": false, 1892 | "platform": [], 1893 | "platform-dev": [] 1894 | } 1895 | -------------------------------------------------------------------------------- /src/BaseFace.php: -------------------------------------------------------------------------------- 1 | ['verify_peer' => false, 'verify_peer_name' => false]]))); 30 | 31 | $result = Api::request(self::UPLOAD_URL, $image); 32 | 33 | if(count($result) !== 0){ 34 | return $result['Host'] . $result['Url']; 35 | }else{ 36 | throw new FetchImageException('获取图片失败'); 37 | } 38 | } 39 | 40 | public function initCookie() 41 | { 42 | Api::request('http://kan.msxiaobing.com/V3/Portal?task=yanzhi&ftid=', [], 'get'); 43 | } 44 | 45 | protected function request($url, $api) 46 | { 47 | $result = $this->upload($url); 48 | 49 | return Api::request($api, [ 50 | 'msgId' => $this->generateTime(), 51 | 'timestamp' => time(), 52 | 'content[imageUrl]' => $result 53 | ]); 54 | } 55 | 56 | /** 57 | * generate a time for api 58 | * 59 | * @return float 60 | */ 61 | protected function generateTime() 62 | { 63 | return time() * 1000; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/Bill.php: -------------------------------------------------------------------------------- 1 | initCookie(); 23 | 24 | $response = $this->request($url, self::BILL_URL); 25 | 26 | return [ 27 | 'text' => $response['content']['text'], 28 | 'url' => $response['content']['imageUrl'] 29 | ]; 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/Clothing.php: -------------------------------------------------------------------------------- 1 | initCookie(); 23 | 24 | $response = $this->request($url, self::CLOTHING_URL); 25 | 26 | $key = explode('key=', $response['content']['imageUrl']); 27 | 28 | return [ 29 | 'text' => $response['content']['text'], 30 | 'url' => 'https://kan.msxiaobing.com/ImageGame/Portal?task=cosmoclothing&aid='.$response['content']['metadata']['aid'].'&key='.$key[1], 31 | 'data' => $response['content']['metadata'] 32 | ]; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /src/Exception/FetchImageException.php: -------------------------------------------------------------------------------- 1 | [ 28 | 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36', 29 | 'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8', 30 | 'Referer' => 'http://kan.msxiaobing.com/V3/Portal?task=yanzhi&ftid=', 31 | ], 32 | 'timeout' => 15, 33 | ]; 34 | 35 | $options = is_array($data) ? array_merge($options, ['form_params' => $data]) : array_merge($options, ['body' => $data]); 36 | 37 | $request = $method === 'post' ? $client->post($api, $options) : $client->get($api); 38 | 39 | $response = $request->getBody()->getContents(); 40 | 41 | return json_decode($response, true); 42 | } 43 | 44 | protected static function getClient() 45 | { 46 | if (self::$client) { 47 | return self::$client; 48 | } 49 | 50 | return self::$client = new Client(['cookies' => true]); 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /src/Foundation/Face.php: -------------------------------------------------------------------------------- 1 | registerProviders(); 51 | } 52 | 53 | /** 54 | * register service providers 55 | */ 56 | private function registerProviders() 57 | { 58 | foreach ($this->providers as $provider) { 59 | $this->register(new $provider()); 60 | } 61 | } 62 | 63 | /** 64 | * Magic get access. 65 | * 66 | * @param string $id 67 | * 68 | * @return mixed 69 | */ 70 | public function __get($id) 71 | { 72 | return $this->offsetGet($id); 73 | } 74 | 75 | /** 76 | * Magic set access. 77 | * 78 | * @param string $id 79 | * @param mixed $value 80 | */ 81 | public function __set($id, $value) 82 | { 83 | $this->offsetSet($id, $value); 84 | } 85 | 86 | 87 | } -------------------------------------------------------------------------------- /src/Foundation/ServiceProviders/BillServiceProvider.php: -------------------------------------------------------------------------------- 1 | initCookie(); 23 | 24 | $response = $this->request($url, self::POEM_URL); 25 | 26 | return [ 27 | 'text' => $response['content']['text'], 28 | 'url' => $response['content']['imageUrl'], 29 | ]; 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/Popular.php: -------------------------------------------------------------------------------- 1 | initCookie(); 23 | 24 | $response = $this->request($url, self::POPULAR_URL); 25 | 26 | $sort = []; 27 | 28 | try { 29 | if (isset($response['content']['metadata']) && ($count = $response['content']['metadata']['FBR_Cnt']) > 0) { 30 | $data = $response['content']['metadata']; 31 | for ($i = 0; $i < $count; $i++){ 32 | $sort[] = ['crowd' => $data['FBR_Key'.$i], 'score' => $data['FBR_Score'.$i]]; 33 | } 34 | } 35 | } catch (\Exception $exception) { 36 | } 37 | 38 | return [ 39 | 'text' => $response['content']['text'], 40 | 'url' => $response['content']['imageUrl'], 41 | 'sort' => $sort 42 | ]; 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /src/Relation.php: -------------------------------------------------------------------------------- 1 | initCookie(); 23 | 24 | $response = $this->request($url, self::RELATION_URL); 25 | 26 | return [ 27 | 'text' => $response['content']['text'], 28 | 'url' => $response['content']['imageUrl'] 29 | ]; 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/Score.php: -------------------------------------------------------------------------------- 1 | initCookie(); 23 | 24 | $response = $this->request($url, self::SCORE_URL); 25 | 26 | return [ 27 | 'score' => $this->regexScore($response['content']['text']), 28 | 'text' => $response['content']['text'], 29 | 'url' => $response['content']['imageUrl'] 30 | ]; 31 | } 32 | 33 | /** 34 | * get a score by regex 35 | * 36 | * @param $scoreText 37 | * @return int 38 | */ 39 | private function regexScore($scoreText) 40 | { 41 | preg_match('/\d+\.\d+/', $scoreText, $score); 42 | 43 | return empty($score[0]) ? 0 : $score[0]; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /tests/BasicTest.php: -------------------------------------------------------------------------------- 1 | face = new Face(); 23 | } 24 | 25 | public function testScore() 26 | { 27 | $result = $this->face->score->get('https://i.loli.net/2017/09/09/59b3d7bcedaa5.jpg'); 28 | 29 | $this->assertContains('http://', $result['url']); 30 | } 31 | 32 | public function testBill() 33 | { 34 | $result = $this->face->bill->get('https://ws1.sinaimg.cn/large/685b97a1gy1fehhwzsk08j20yf0yiabd.jpg'); 35 | 36 | $this->assertContains('http://', $result['url']); 37 | } 38 | 39 | public function testPopular() 40 | { 41 | $result = $this->face->popular->get('https://ooo.0o0.ooo/2017/04/10/58eb93efa1aae.jpg'); 42 | 43 | $this->assertContains('http://', $result['url']); 44 | } 45 | 46 | public function testRelation() 47 | { 48 | $result = $this->face->relation->get('https://ooo.0o0.ooo/2017/04/10/58eb978fdaad7.jpg'); 49 | 50 | $this->assertContains('http://', $result['url']); 51 | } 52 | 53 | public function testClothing() 54 | { 55 | $result = $this->face->clothing->get('https://i.loli.net/2017/09/09/59b3e36a718bb.jpg'); 56 | 57 | $this->assertContains('http://', $result['url']); 58 | } 59 | 60 | public function testPoem() 61 | { 62 | $result = $this->face->poem->get('https://i.loli.net/2017/09/09/59b3e36a718bb.jpg'); 63 | 64 | $this->assertContains('http://', $result['url']); 65 | } 66 | } --------------------------------------------------------------------------------