From 7f2b8198613b2d61a3143a007118214eecc53319 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 6 Mar 2020 13:34:37 +0000 Subject: [PATCH] remove the console command --- bin/crawler | 13 -- composer.json | 3 +- composer.lock | 333 ++++++------------------------------- src/ConsoleApplication.php | 22 --- src/CrawlCommand.php | 54 ------ 5 files changed, 48 insertions(+), 377 deletions(-) delete mode 100755 bin/crawler delete mode 100644 src/ConsoleApplication.php delete mode 100644 src/CrawlCommand.php diff --git a/bin/crawler b/bin/crawler deleted file mode 100755 index eb8689d..0000000 --- a/bin/crawler +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env php - -run(); diff --git a/composer.json b/composer.json index e35165c..965ad5f 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,10 @@ { "name": "jhodges/sitemap", "description": "Generate full sitemap report using spatie/crawler", - "type": "project", + "type": "library", "require": { "php": "^7.1", "spatie/crawler": "^4.6", - "symfony/console": "^4.0|^5.0", "cweagans/composer-patches": "~1.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 3bf549f..aa6b492 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0f0e1a413fb5eda56634b65a8abfdbf4", + "content-hash": "ae8a16f174016481a2eb2bbff7a3c8be", "packages": [ { "name": "cweagans/composer-patches", @@ -83,6 +83,9 @@ "extra": { "branch-alias": { "dev-master": "6.5-dev" + }, + "patches_applied": { + "Status code must be an integer value between 1xx and 5xx": "https://patch-diff.githubusercontent.com/raw/guzzle/guzzle/pull/2591.patch" } }, "autoload": { @@ -490,55 +493,6 @@ "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/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14T16:28:37+00:00" - }, { "name": "psr/http-message", "version": "1.0.1", @@ -678,16 +632,16 @@ }, { "name": "spatie/browsershot", - "version": "3.34.0", + "version": "3.35.0", "source": { "type": "git", "url": "https://github.com/spatie/browsershot.git", - "reference": "483f62d03ea8cfc20091b9c2db1ed3f597d659f1" + "reference": "adb9e91c409462152b0baff473b2fa47cf413150" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/browsershot/zipball/483f62d03ea8cfc20091b9c2db1ed3f597d659f1", - "reference": "483f62d03ea8cfc20091b9c2db1ed3f597d659f1", + "url": "https://api.github.com/repos/spatie/browsershot/zipball/adb9e91c409462152b0baff473b2fa47cf413150", + "reference": "adb9e91c409462152b0baff473b2fa47cf413150", "shasum": "" }, "require": { @@ -730,7 +684,7 @@ "screenshot", "webpage" ], - "time": "2020-01-04T22:37:18+00:00" + "time": "2020-03-05T08:48:51+00:00" }, { "name": "spatie/crawler", @@ -991,94 +945,18 @@ ], "time": "2019-12-15T18:52:09+00:00" }, - { - "name": "symfony/console", - "version": "v5.0.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "91c294166c38d8c0858a86fad76d8c14dc1144c8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/91c294166c38d8c0858a86fad76d8c14dc1144c8", - "reference": "91c294166c38d8c0858a86fad76d8c14dc1144c8", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1|^2" - }, - "conflict": { - "symfony/dependency-injection": "<4.4", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "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 Console Component", - "homepage": "https://symfony.com", - "time": "2020-01-25T15:56:29+00:00" - }, { "name": "symfony/dom-crawler", - "version": "v5.0.4", + "version": "v5.0.5", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "439c3c7be4daa569deef0dd1e30cf3562108d062" + "reference": "4368bdd61b83af365b8f23e9616d2a2ed52cbe7c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/439c3c7be4daa569deef0dd1e30cf3562108d062", - "reference": "439c3c7be4daa569deef0dd1e30cf3562108d062", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/4368bdd61b83af365b8f23e9616d2a2ed52cbe7c", + "reference": "4368bdd61b83af365b8f23e9616d2a2ed52cbe7c", "shasum": "" }, "require": { @@ -1126,7 +1004,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2020-01-04T14:08:26+00:00" + "time": "2020-02-29T10:07:09+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1245,76 +1123,18 @@ ], "time": "2020-01-13T11:15:53+00:00" }, - { - "name": "symfony/polyfill-php73", - "version": "v1.14.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "5e66a0fa1070bf46bec4bea7962d285108edd675" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/5e66a0fa1070bf46bec4bea7962d285108edd675", - "reference": "5e66a0fa1070bf46bec4bea7962d285108edd675", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.14-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "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 backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2020-01-13T11:15:53+00:00" - }, { "name": "symfony/process", - "version": "v5.0.4", + "version": "v5.0.5", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "f9ffd870f5ac01abec7b2b5e15f904ca9400ecd1" + "reference": "fd4a86dd7e36437f2fc080d8c42c7415d828a0a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/f9ffd870f5ac01abec7b2b5e15f904ca9400ecd1", - "reference": "f9ffd870f5ac01abec7b2b5e15f904ca9400ecd1", + "url": "https://api.github.com/repos/symfony/process/zipball/fd4a86dd7e36437f2fc080d8c42c7415d828a0a8", + "reference": "fd4a86dd7e36437f2fc080d8c42c7415d828a0a8", "shasum": "" }, "require": { @@ -1350,78 +1170,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2020-01-09T09:53:06+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v2.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "144c5e51266b281231e947b51223ba14acf1a749" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", - "reference": "144c5e51266b281231e947b51223ba14acf1a749", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "psr/container": "^1.0" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "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": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2019-11-18T17:27:11+00:00" + "time": "2020-02-08T17:00:58+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.0.4", + "version": "v5.0.5", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "923591cfb78a935f0c98968fedfad05bfda9d01f" + "reference": "3a37aeb1132d1035536d3d6aa9cb06c2ff9355e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/923591cfb78a935f0c98968fedfad05bfda9d01f", - "reference": "923591cfb78a935f0c98968fedfad05bfda9d01f", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3a37aeb1132d1035536d3d6aa9cb06c2ff9355e9", + "reference": "3a37aeb1132d1035536d3d6aa9cb06c2ff9355e9", "shasum": "" }, "require": { @@ -1483,20 +1245,20 @@ "debug", "dump" ], - "time": "2020-01-25T15:56:29+00:00" + "time": "2020-02-26T22:30:10+00:00" }, { "name": "tightenco/collect", - "version": "v6.16.0", + "version": "v6.17.0", "source": { "type": "git", "url": "https://github.com/tightenco/collect.git", - "reference": "75e997d1803c2e979ce6f314a5df8a97a8af93b0" + "reference": "bc554bfb79fc02b4e6e1dd463a7fa8470119e9ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tightenco/collect/zipball/75e997d1803c2e979ce6f314a5df8a97a8af93b0", - "reference": "75e997d1803c2e979ce6f314a5df8a97a8af93b0", + "url": "https://api.github.com/repos/tightenco/collect/zipball/bc554bfb79fc02b4e6e1dd463a7fa8470119e9ab", + "reference": "bc554bfb79fc02b4e6e1dd463a7fa8470119e9ab", "shasum": "" }, "require": { @@ -1533,7 +1295,7 @@ "collection", "laravel" ], - "time": "2020-02-18T17:25:13+00:00" + "time": "2020-02-25T19:45:47+00:00" } ], "packages-dev": [ @@ -1797,16 +1559,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.0.0", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "a48807183a4b819072f26e347bbd0b5199a9d15f" + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/a48807183a4b819072f26e347bbd0b5199a9d15f", - "reference": "a48807183a4b819072f26e347bbd0b5199a9d15f", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", "shasum": "" }, "require": { @@ -1846,30 +1608,29 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-02-09T09:16:15+00:00" + "time": "2020-02-22T12:28:44+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95", + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95", "shasum": "" }, "require": { - "php": "^7.1", + "php": "^7.2", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "^7.1", - "mockery/mockery": "~1", - "phpunit/phpunit": "^7.0" + "ext-tokenizer": "^7.2", + "mockery/mockery": "~1" }, "type": "library", "extra": { @@ -1893,20 +1654,20 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2019-08-22T18:11:29+00:00" + "time": "2020-02-18T18:59:58+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.10.2", + "version": "v1.10.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9" + "reference": "451c3cd1418cf640de218914901e51b064abb093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9", - "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", "shasum": "" }, "require": { @@ -1956,7 +1717,7 @@ "spy", "stub" ], - "time": "2020-01-20T15:57:02+00:00" + "time": "2020-03-05T15:02:03+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/src/ConsoleApplication.php b/src/ConsoleApplication.php deleted file mode 100644 index d68f2fe..0000000 --- a/src/ConsoleApplication.php +++ /dev/null @@ -1,22 +0,0 @@ -add(new CrawlCommand()); - } - - public function getLongVersion() - { - return parent::getLongVersion().' by JHodges'; - } -} diff --git a/src/CrawlCommand.php b/src/CrawlCommand.php deleted file mode 100644 index 0b87c2d..0000000 --- a/src/CrawlCommand.php +++ /dev/null @@ -1,54 +0,0 @@ -setName('crawl') - ->setDescription('Crawl and generate sitemap for the website.') - ->addArgument( - 'url', - InputArgument::REQUIRED, - 'The url to check' - )->addOption( - 'found-on', - 'f', - InputOption::VALUE_NONE, - 'Display found on URLs' - ); - } - - /** - * @param \Symfony\Component\Console\Input\InputInterface $input - * @param \Symfony\Component\Console\Output\OutputInterface $output - * - * @return int - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $baseUrl = $input->getArgument('url'); - $crawler=new Crawler([RequestOptions::CONNECT_TIMEOUT => 60, RequestOptions::TIMEOUT => 60]); - $crawler->crawl($baseUrl); - - foreach($crawler->getResults() as $url=>$result){ - $output->writeln("{$result['code']} {$url}"); - if($input->getOption('found-on')){ - foreach($result['foundOn'] as $url=>$count){ - $output->writeln(" -> ($count) $url"); - } - } - } - - return 0; - } -}