From ac7b8490360465737d65f7c0cff7372147278a22 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 21 Feb 2020 10:24:34 +0000 Subject: [PATCH] make observer collate all found on urls --- composer.json | 11 +- composer.lock | 1786 +++++++++++++++++++++-------------------- src/CrawlObserver.php | 66 +- src/Crawler.php | 23 +- 4 files changed, 977 insertions(+), 909 deletions(-) diff --git a/composer.json b/composer.json index 59adce7..2aadb8b 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,9 @@ "type": "project", "require": { "spatie/crawler": "^4.6", + "cweagans/composer-patches": "~1.0" + }, + "require-dev": { "phpunit/phpunit": "^8.5" }, "authors": [ @@ -16,6 +19,12 @@ "psr-4": { "JHodges\\Sitemap\\": "src/" } + }, + "extra": { + "patches": { + "spatie/crawler": { + "add crawled again observer": "https://patch-diff.githubusercontent.com/raw/spatie/crawler/pull/280.patch" + } + } } - } diff --git a/composer.lock b/composer.lock index 972c36c..2fe9042 100644 --- a/composer.lock +++ b/composer.lock @@ -4,63 +4,51 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "92cabe9d63fb22e48fa2e85d97a410f8", + "content-hash": "635f636b861c8e79694a12db07fa6800", "packages": [ { - "name": "doctrine/instantiator", - "version": "1.3.0", + "name": "cweagans/composer-patches", + "version": "1.6.7", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + "url": "https://github.com/cweagans/composer-patches.git", + "reference": "2e6f72a2ad8d59cd7e2b729f218bf42adb14f590" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/2e6f72a2ad8d59cd7e2b729f218bf42adb14f590", + "reference": "2e6f72a2ad8d59cd7e2b729f218bf42adb14f590", "shasum": "" }, "require": { - "php": "^7.1" + "composer-plugin-api": "^1.0", + "php": ">=5.3.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "composer/composer": "~1.0", + "phpunit/phpunit": "~4.6" }, - "type": "library", + "type": "composer-plugin", "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } + "class": "cweagans\\Composer\\Patches" }, "autoload": { "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "cweagans\\Composer\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "name": "Cameron Eagans", + "email": "me@cweagans.net" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2019-10-21T16:45:58+00:00" + "description": "Provides a way to patch Composer packages.", + "time": "2019-08-29T20:11:49+00:00" }, { "name": "guzzlehttp/guzzle", @@ -466,6 +454,904 @@ ], "time": "2019-04-03T23:46:42+00:00" }, + { + "name": "nicmart/tree", + "version": "v0.2.7", + "source": { + "type": "git", + "url": "https://github.com/nicmart/Tree.git", + "reference": "0616b54bb49938e1a816141d7943db48ebf76938" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nicmart/Tree/zipball/0616b54bb49938e1a816141d7943db48ebf76938", + "reference": "0616b54bb49938e1a816141d7943db48ebf76938", + "shasum": "" + }, + "require": { + "php": ">=5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Tree\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolò Martini", + "email": "nicmartnic@gmail.com" + } + ], + "description": "A basic but flexible php tree data structure and a fluent tree builder implementation.", + "time": "2015-08-20T20:50:35+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2019-11-01T11:05:21+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "spatie/browsershot", + "version": "3.34.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/browsershot.git", + "reference": "483f62d03ea8cfc20091b9c2db1ed3f597d659f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/browsershot/zipball/483f62d03ea8cfc20091b9c2db1ed3f597d659f1", + "reference": "483f62d03ea8cfc20091b9c2db1ed3f597d659f1", + "shasum": "" + }, + "require": { + "php": "^7.1", + "spatie/image": "^1.5.3", + "spatie/temporary-directory": "^1.1", + "symfony/process": "^4.2|^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.1|^7.5", + "spatie/phpunit-snapshot-assertions": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Browsershot\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://github.com/freekmurze", + "role": "Developer" + } + ], + "description": "Convert a webpage to an image or pdf using headless Chrome", + "homepage": "https://github.com/spatie/browsershot", + "keywords": [ + "chrome", + "convert", + "headless", + "image", + "pdf", + "puppeteer", + "screenshot", + "webpage" + ], + "time": "2020-01-04T22:37:18+00:00" + }, + { + "name": "spatie/crawler", + "version": "4.6.6", + "source": { + "type": "git", + "url": "https://github.com/spatie/crawler.git", + "reference": "6f814a401cee20b24a1ffe53d8deddac90d1a42d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/crawler/zipball/6f814a401cee20b24a1ffe53d8deddac90d1a42d", + "reference": "6f814a401cee20b24a1ffe53d8deddac90d1a42d", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.3 || ^7.0", + "guzzlehttp/psr7": "^1.4", + "nicmart/tree": "^0.2.7", + "php": "^7.1", + "spatie/browsershot": "^3.14", + "spatie/robots-txt": "^1.0.1", + "symfony/dom-crawler": "^4.0 || ^5.0", + "tightenco/collect": "^5.6|^6.0" + }, + "require-dev": { + "larapack/dd": "^1.1", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.0.x-dev" + }, + "patches_applied": { + "add crawled again observer": "https://patch-diff.githubusercontent.com/raw/spatie/crawler/pull/280.patch" + } + }, + "autoload": { + "psr-4": { + "Spatie\\Crawler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be" + } + ], + "description": "Crawl all internal links found on a website", + "homepage": "https://github.com/spatie/crawler", + "keywords": [ + "crawler", + "link", + "spatie", + "website" + ], + "time": "2020-01-31T10:51:58+00:00" + }, + { + "name": "spatie/image", + "version": "1.7.6", + "source": { + "type": "git", + "url": "https://github.com/spatie/image.git", + "reference": "74535b5fd67ace75840c00c408666660843e755e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/image/zipball/74535b5fd67ace75840c00c408666660843e755e", + "reference": "74535b5fd67ace75840c00c408666660843e755e", + "shasum": "" + }, + "require": { + "ext-exif": "*", + "ext-mbstring": "*", + "league/glide": "^1.4", + "php": "^7.0", + "spatie/image-optimizer": "^1.0", + "spatie/temporary-directory": "^1.0.0", + "symfony/process": "^3.0|^4.0|^5.0" + }, + "require-dev": { + "larapack/dd": "^1.1", + "phpunit/phpunit": "^6.0|^7.0", + "symfony/var-dumper": "^3.2|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Image\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Manipulate images with an expressive API", + "homepage": "https://github.com/spatie/image", + "keywords": [ + "image", + "spatie" + ], + "time": "2020-01-26T18:56:44+00:00" + }, + { + "name": "spatie/image-optimizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/image-optimizer.git", + "reference": "9c1d470e34b28b715d25edb539dd6c899461527c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/9c1d470e34b28b715d25edb539dd6c899461527c", + "reference": "9c1d470e34b28b715d25edb539dd6c899461527c", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.2", + "psr/log": "^1.0", + "symfony/process": "^4.2|^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0", + "symfony/var-dumper": "^4.2|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\ImageOptimizer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Easily optimize images using PHP", + "homepage": "https://github.com/spatie/image-optimizer", + "keywords": [ + "image-optimizer", + "spatie" + ], + "time": "2019-11-25T12:29:24+00:00" + }, + { + "name": "spatie/robots-txt", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/spatie/robots-txt.git", + "reference": "dbd8d2048114f81813a57d21da594dbde77fdac7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/robots-txt/zipball/dbd8d2048114f81813a57d21da594dbde77fdac7", + "reference": "dbd8d2048114f81813a57d21da594dbde77fdac7", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "larapack/dd": "^1.0", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Robots\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brent Roose", + "email": "brent@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Determine if a page may be crawled from robots.txt and robots meta tags", + "homepage": "https://github.com/spatie/robots-txt", + "keywords": [ + "robots-txt", + "spatie" + ], + "time": "2019-08-07T22:29:10+00:00" + }, + { + "name": "spatie/temporary-directory", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/spatie/temporary-directory.git", + "reference": "fcb127e615700751dac2aefee0ea2808ff3f5bb1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/fcb127e615700751dac2aefee0ea2808ff3f5bb1", + "reference": "fcb127e615700751dac2aefee0ea2808ff3f5bb1", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\TemporaryDirectory\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alex Vanderbist", + "email": "alex@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Easily create, use and destroy temporary directories", + "homepage": "https://github.com/spatie/temporary-directory", + "keywords": [ + "spatie", + "temporary-directory" + ], + "time": "2019-12-15T18:52:09+00:00" + }, + { + "name": "symfony/dom-crawler", + "version": "v5.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/dom-crawler.git", + "reference": "439c3c7be4daa569deef0dd1e30cf3562108d062" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/439c3c7be4daa569deef0dd1e30cf3562108d062", + "reference": "439c3c7be4daa569deef0dd1e30cf3562108d062", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "masterminds/html5": "<2.6" + }, + "require-dev": { + "masterminds/html5": "^2.6", + "symfony/css-selector": "^4.4|^5.0" + }, + "suggest": { + "symfony/css-selector": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\DomCrawler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DomCrawler Component", + "homepage": "https://symfony.com", + "time": "2020-01-04T14:08:26+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.14-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2020-01-13T11:15:53+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/34094cfa9abe1f0f14f48f490772db7a775559f2", + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.14-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2020-01-13T11:15:53+00:00" + }, + { + "name": "symfony/process", + "version": "v5.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "f9ffd870f5ac01abec7b2b5e15f904ca9400ecd1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/f9ffd870f5ac01abec7b2b5e15f904ca9400ecd1", + "reference": "f9ffd870f5ac01abec7b2b5e15f904ca9400ecd1", + "shasum": "" + }, + "require": { + "php": "^7.2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2020-01-09T09:53:06+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v5.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "923591cfb78a935f0c98968fedfad05bfda9d01f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/923591cfb78a935f0c98968fedfad05bfda9d01f", + "reference": "923591cfb78a935f0c98968fedfad05bfda9d01f", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "phpunit/phpunit": "<5.4.3", + "symfony/console": "<4.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "twig/twig": "^2.4|^3.0" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony mechanism for exploring and dumping PHP variables", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "time": "2020-01-25T15:56:29+00:00" + }, + { + "name": "tightenco/collect", + "version": "v6.16.0", + "source": { + "type": "git", + "url": "https://github.com/tightenco/collect.git", + "reference": "75e997d1803c2e979ce6f314a5df8a97a8af93b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tightenco/collect/zipball/75e997d1803c2e979ce6f314a5df8a97a8af93b0", + "reference": "75e997d1803c2e979ce6f314a5df8a97a8af93b0", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "nesbot/carbon": "^2.23.0", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/Collect/Support/helpers.php", + "src/Collect/Support/alias.php" + ], + "psr-4": { + "Tightenco\\Collect\\": "src/Collect" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "description": "Collect - Illuminate Collections as a separate package.", + "keywords": [ + "collection", + "laravel" + ], + "time": "2020-02-18T17:25:13+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2019-10-21T16:45:58+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.9.5", @@ -514,42 +1400,6 @@ ], "time": "2020-01-17T21:11:47+00:00" }, - { - "name": "nicmart/tree", - "version": "v0.2.7", - "source": { - "type": "git", - "url": "https://github.com/nicmart/Tree.git", - "reference": "0616b54bb49938e1a816141d7943db48ebf76938" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nicmart/Tree/zipball/0616b54bb49938e1a816141d7943db48ebf76938", - "reference": "0616b54bb49938e1a816141d7943db48ebf76938", - "shasum": "" - }, - "require": { - "php": ">=5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Tree\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolò Martini", - "email": "nicmartnic@gmail.com" - } - ], - "description": "A basic but flexible php tree data structure and a fluent tree builder implementation.", - "time": "2015-08-20T20:50:35+00:00" - }, { "name": "phar-io/manifest", "version": "1.0.3", @@ -1202,143 +2052,6 @@ ], "time": "2020-01-08T08:49:49+00:00" }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "psr/log", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2019-11-01T11:05:21+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "time": "2019-03-08T08:55:37+00:00" - }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", @@ -1954,620 +2667,6 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2016-10-03T07:35:21+00:00" }, - { - "name": "spatie/browsershot", - "version": "3.34.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/browsershot.git", - "reference": "483f62d03ea8cfc20091b9c2db1ed3f597d659f1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/browsershot/zipball/483f62d03ea8cfc20091b9c2db1ed3f597d659f1", - "reference": "483f62d03ea8cfc20091b9c2db1ed3f597d659f1", - "shasum": "" - }, - "require": { - "php": "^7.1", - "spatie/image": "^1.5.3", - "spatie/temporary-directory": "^1.1", - "symfony/process": "^4.2|^5.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.1|^7.5", - "spatie/phpunit-snapshot-assertions": "^1.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\Browsershot\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://github.com/freekmurze", - "role": "Developer" - } - ], - "description": "Convert a webpage to an image or pdf using headless Chrome", - "homepage": "https://github.com/spatie/browsershot", - "keywords": [ - "chrome", - "convert", - "headless", - "image", - "pdf", - "puppeteer", - "screenshot", - "webpage" - ], - "time": "2020-01-04T22:37:18+00:00" - }, - { - "name": "spatie/crawler", - "version": "4.6.6", - "source": { - "type": "git", - "url": "https://github.com/spatie/crawler.git", - "reference": "6f814a401cee20b24a1ffe53d8deddac90d1a42d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/crawler/zipball/6f814a401cee20b24a1ffe53d8deddac90d1a42d", - "reference": "6f814a401cee20b24a1ffe53d8deddac90d1a42d", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.3 || ^7.0", - "guzzlehttp/psr7": "^1.4", - "nicmart/tree": "^0.2.7", - "php": "^7.1", - "spatie/browsershot": "^3.14", - "spatie/robots-txt": "^1.0.1", - "symfony/dom-crawler": "^4.0 || ^5.0", - "tightenco/collect": "^5.6|^6.0" - }, - "require-dev": { - "larapack/dd": "^1.1", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Spatie\\Crawler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be" - } - ], - "description": "Crawl all internal links found on a website", - "homepage": "https://github.com/spatie/crawler", - "keywords": [ - "crawler", - "link", - "spatie", - "website" - ], - "time": "2020-01-31T10:51:58+00:00" - }, - { - "name": "spatie/image", - "version": "1.7.6", - "source": { - "type": "git", - "url": "https://github.com/spatie/image.git", - "reference": "74535b5fd67ace75840c00c408666660843e755e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/image/zipball/74535b5fd67ace75840c00c408666660843e755e", - "reference": "74535b5fd67ace75840c00c408666660843e755e", - "shasum": "" - }, - "require": { - "ext-exif": "*", - "ext-mbstring": "*", - "league/glide": "^1.4", - "php": "^7.0", - "spatie/image-optimizer": "^1.0", - "spatie/temporary-directory": "^1.0.0", - "symfony/process": "^3.0|^4.0|^5.0" - }, - "require-dev": { - "larapack/dd": "^1.1", - "phpunit/phpunit": "^6.0|^7.0", - "symfony/var-dumper": "^3.2|^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\Image\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "Manipulate images with an expressive API", - "homepage": "https://github.com/spatie/image", - "keywords": [ - "image", - "spatie" - ], - "time": "2020-01-26T18:56:44+00:00" - }, - { - "name": "spatie/image-optimizer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/spatie/image-optimizer.git", - "reference": "9c1d470e34b28b715d25edb539dd6c899461527c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/9c1d470e34b28b715d25edb539dd6c899461527c", - "reference": "9c1d470e34b28b715d25edb539dd6c899461527c", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "php": "^7.2", - "psr/log": "^1.0", - "symfony/process": "^4.2|^5.0" - }, - "require-dev": { - "phpunit/phpunit": "^8.0", - "symfony/var-dumper": "^4.2|^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\ImageOptimizer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "Easily optimize images using PHP", - "homepage": "https://github.com/spatie/image-optimizer", - "keywords": [ - "image-optimizer", - "spatie" - ], - "time": "2019-11-25T12:29:24+00:00" - }, - { - "name": "spatie/robots-txt", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/spatie/robots-txt.git", - "reference": "dbd8d2048114f81813a57d21da594dbde77fdac7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/robots-txt/zipball/dbd8d2048114f81813a57d21da594dbde77fdac7", - "reference": "dbd8d2048114f81813a57d21da594dbde77fdac7", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "larapack/dd": "^1.0", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\Robots\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brent Roose", - "email": "brent@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "Determine if a page may be crawled from robots.txt and robots meta tags", - "homepage": "https://github.com/spatie/robots-txt", - "keywords": [ - "robots-txt", - "spatie" - ], - "time": "2019-08-07T22:29:10+00:00" - }, - { - "name": "spatie/temporary-directory", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/spatie/temporary-directory.git", - "reference": "fcb127e615700751dac2aefee0ea2808ff3f5bb1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/fcb127e615700751dac2aefee0ea2808ff3f5bb1", - "reference": "fcb127e615700751dac2aefee0ea2808ff3f5bb1", - "shasum": "" - }, - "require": { - "php": "^7.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\TemporaryDirectory\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alex Vanderbist", - "email": "alex@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "Easily create, use and destroy temporary directories", - "homepage": "https://github.com/spatie/temporary-directory", - "keywords": [ - "spatie", - "temporary-directory" - ], - "time": "2019-12-15T18:52:09+00:00" - }, - { - "name": "symfony/dom-crawler", - "version": "v5.0.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "439c3c7be4daa569deef0dd1e30cf3562108d062" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/439c3c7be4daa569deef0dd1e30cf3562108d062", - "reference": "439c3c7be4daa569deef0dd1e30cf3562108d062", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "masterminds/html5": "<2.6" - }, - "require-dev": { - "masterminds/html5": "^2.6", - "symfony/css-selector": "^4.4|^5.0" - }, - "suggest": { - "symfony/css-selector": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony DomCrawler Component", - "homepage": "https://symfony.com", - "time": "2020-01-04T14:08:26+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.14.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", - "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.14-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "time": "2020-01-13T11:15:53+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.14.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/34094cfa9abe1f0f14f48f490772db7a775559f2", - "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.14-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2020-01-13T11:15:53+00:00" - }, - { - "name": "symfony/process", - "version": "v5.0.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "f9ffd870f5ac01abec7b2b5e15f904ca9400ecd1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/f9ffd870f5ac01abec7b2b5e15f904ca9400ecd1", - "reference": "f9ffd870f5ac01abec7b2b5e15f904ca9400ecd1", - "shasum": "" - }, - "require": { - "php": "^7.2.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2020-01-09T09:53:06+00:00" - }, - { - "name": "symfony/var-dumper", - "version": "v5.0.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/var-dumper.git", - "reference": "923591cfb78a935f0c98968fedfad05bfda9d01f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/923591cfb78a935f0c98968fedfad05bfda9d01f", - "reference": "923591cfb78a935f0c98968fedfad05bfda9d01f", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.3", - "symfony/console": "<4.4" - }, - "require-dev": { - "ext-iconv": "*", - "symfony/console": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "twig/twig": "^2.4|^3.0" - }, - "suggest": { - "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", - "ext-intl": "To show region name in time zone dump", - "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" - }, - "bin": [ - "Resources/bin/var-dump-server" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "files": [ - "Resources/functions/dump.php" - ], - "psr-4": { - "Symfony\\Component\\VarDumper\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony mechanism for exploring and dumping PHP variables", - "homepage": "https://symfony.com", - "keywords": [ - "debug", - "dump" - ], - "time": "2020-01-25T15:56:29+00:00" - }, { "name": "theseer/tokenizer", "version": "1.1.3", @@ -2608,56 +2707,6 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "time": "2019-06-13T22:48:21+00:00" }, - { - "name": "tightenco/collect", - "version": "v6.16.0", - "source": { - "type": "git", - "url": "https://github.com/tightenco/collect.git", - "reference": "75e997d1803c2e979ce6f314a5df8a97a8af93b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/tightenco/collect/zipball/75e997d1803c2e979ce6f314a5df8a97a8af93b0", - "reference": "75e997d1803c2e979ce6f314a5df8a97a8af93b0", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "symfony/var-dumper": "^3.4 || ^4.0 || ^5.0" - }, - "require-dev": { - "mockery/mockery": "^1.0", - "nesbot/carbon": "^2.23.0", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "autoload": { - "files": [ - "src/Collect/Support/helpers.php", - "src/Collect/Support/alias.php" - ], - "psr-4": { - "Tightenco\\Collect\\": "src/Collect" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylorotwell@gmail.com" - } - ], - "description": "Collect - Illuminate Collections as a separate package.", - "keywords": [ - "collection", - "laravel" - ], - "time": "2020-02-18T17:25:13+00:00" - }, { "name": "webmozart/assert", "version": "1.7.0", @@ -2707,7 +2756,6 @@ "time": "2020-02-14T12:15:55+00:00" } ], - "packages-dev": [], "aliases": [], "minimum-stability": "stable", "stability-flags": [], diff --git a/src/CrawlObserver.php b/src/CrawlObserver.php index 0307455..391b371 100644 --- a/src/CrawlObserver.php +++ b/src/CrawlObserver.php @@ -21,7 +21,6 @@ class CrawlObserver extends \Spatie\Crawler\CrawlObserver */ public function willCrawl(UriInterface $url) { - echo "Will:$url\n"; } /** @@ -38,9 +37,9 @@ class CrawlObserver extends \Spatie\Crawler\CrawlObserver ){ // https://github.com/guzzle/guzzle/blob/master/docs/faq.rst#how-can-i-track-redirected-requests - // Retrieve both Redirect History headers - $fullRedirectReport = []; if($response->getHeader('X-Guzzle-Redirect-History')){ + // Retrieve both Redirect History headers + $fullRedirectReport = []; // Retrieve both Redirect History headers $redirectUriHistory = $response->getHeader('X-Guzzle-Redirect-History'); // retrieve Redirect URI history $redirectCodeHistory = $response->getHeader('X-Guzzle-Redirect-Status-History'); // retrieve Redirect HTTP Status history @@ -52,18 +51,38 @@ class CrawlObserver extends \Spatie\Crawler\CrawlObserver foreach ($redirectUriHistory as $key => $value) { $fullRedirectReport[$key] = ['location' => $value, 'code' => $redirectCodeHistory[$key]]; } - } - foreach($fullRedirectReport as $rr){ - $this->results[]=[ - 'location'=>(String)$rr['location'], - 'code'=>$rr['code'], + foreach($fullRedirectReport as $rr){ + $this->results[(String)$rr['location']]=[ + 'code'=>$rr['code'], + 'type'=>$response->getHeader('Content-Type')[0]??null, + 'foundOn'=>[(string)$foundOnUrl], + ]; + } + }else{ + $this->results[(String)$url]=[ + 'code'=>$response->getStatusCode(), 'type'=>$response->getHeader('Content-Type')[0]??null, - 'foundOn'=>(string)$foundOnUrl, + 'foundOn'=>[(string)$foundOnUrl], ]; } } + /** + * Called when the crawler has found the url again + * + * @param \Psr\Http\Message\UriInterface $url + * @param \Psr\Http\Message\ResponseInterface $response + * @param \Psr\Http\Message\UriInterface|null $foundOnUrl + */ + public function alreadyCrawled( + UriInterface $url, + ?UriInterface $foundOnUrl = null + ){ + $this->results[(String)$url]['foundOn'][]=(string)$foundOnUrl; + } + + /** * Called when the crawler had a problem crawling the given url. * @@ -76,36 +95,21 @@ class CrawlObserver extends \Spatie\Crawler\CrawlObserver RequestException $requestException, ?UriInterface $foundOnUrl = null ){ - if($response=$requestException->getResponse()){ - $code=$response->getStatusCode(); - $type=$response->getHeader('Content-Type')[0]??null; + if( $response=$requestException->getResponse() ){ + $this->crawled($url,$response,$foundOnUrl); }else{ - $code='???'; - $type=''; + $this->results[(String)$url]=[ + 'code'=>'???', + 'type'=>'???', + 'foundOn'=>[(string)$foundOnUrl], + ]; } - - // Retrieve both Redirect History headers - $fullRedirectReport = []; - if($response && $response->getHeader('X-Guzzle-Redirect-History')){ - $redirectUriHistory = $response->getHeader('X-Guzzle-Redirect-History'); // retrieve Redirect URI history - $redirectCodeHistory = $response->getHeader('X-Guzzle-Redirect-Status-History'); // retrieve Redirect HTTP Status history - $fullRedirectReport=[$redirectUriHistory,$redirectCodeHistory]; - } - - $this->results[]=[ - 'link'=>(String)$url, - 'code'=>$code, - 'type'=>$type, - 'parent'=>(string)$foundOnUrl, - 'redirects'=>$fullRedirectReport, - ]; } /** * Called when the crawl has ended. */ public function finishedCrawling() { - //print_r($this->results); } } diff --git a/src/Crawler.php b/src/Crawler.php index c7a134c..9d81206 100644 --- a/src/Crawler.php +++ b/src/Crawler.php @@ -13,21 +13,28 @@ use Spatie\Crawler\CrawlInternalUrls; class Crawler{ - public function Crawl($url){ - $observer=new CrawlObserver(); + private $observer; + private $crawler; - SpatieCrawler::create([ + public function __construct($baseUrl){ + $this->observer = new CrawlObserver(); + $this->crawler = SpatieCrawler::create([ RequestOptions::ALLOW_REDIRECTS => [ 'track_redirects' => true, ] ]) //->setMaximumDepth(1) - ->setCrawlObserver($observer) - ->setCrawlProfile(new CrawlInternalUrls($url)) - //->addToCrawlQueue( CrawlUrl::create(new Uri('https://hudevad.com/en/')) ) - ->startCrawling($url) + ->setCrawlProfile(new CrawlInternalUrls($baseUrl)) + ->setCrawlObserver($this->observer) ; - return $observer->results; + } + + public function crawl($url){ + $this->crawler->startCrawling($url); + } + + public function getResults(){ + return $this->observer->results; } }