{"id":45716589,"url":"https://github.com/emmanuelroecker/php-linkchecker","last_synced_at":"2026-02-25T04:09:34.116Z","repository":{"id":29457923,"uuid":"32994341","full_name":"emmanuelroecker/php-linkchecker","owner":"emmanuelroecker","description":"Check broken links in html / json files, sitemap.xml, markdown and robots.txt","archived":false,"fork":false,"pushed_at":"2021-01-19T18:14:33.000Z","size":42,"stargazers_count":28,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-10T10:12:02.038Z","etag":null,"topics":["html","links","php","php-linkchecker"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emmanuelroecker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-27T15:38:55.000Z","updated_at":"2023-03-02T16:03:13.000Z","dependencies_parsed_at":"2022-09-06T17:51:49.869Z","dependency_job_id":null,"html_url":"https://github.com/emmanuelroecker/php-linkchecker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/emmanuelroecker/php-linkchecker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmanuelroecker%2Fphp-linkchecker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmanuelroecker%2Fphp-linkchecker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmanuelroecker%2Fphp-linkchecker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmanuelroecker%2Fphp-linkchecker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmanuelroecker","download_url":"https://codeload.github.com/emmanuelroecker/php-linkchecker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmanuelroecker%2Fphp-linkchecker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29810431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T03:30:18.102Z","status":"ssl_error","status_checked_at":"2026-02-25T03:30:17.799Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html","links","php","php-linkchecker"],"created_at":"2026-02-25T04:09:33.550Z","updated_at":"2026-02-25T04:09:34.109Z","avatar_url":"https://github.com/emmanuelroecker.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-linkchecker \n\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/emmanuelroecker/php-linkchecker/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/emmanuelroecker/php-linkchecker/?branch=master)\n[![Build Status](https://travis-ci.org/emmanuelroecker/php-linkchecker.svg?branch=master)](https://travis-ci.org/emmanuelroecker/php-linkchecker)\n[![Coverage Status](https://coveralls.io/repos/github/emmanuelroecker/php-linkchecker/badge.svg?branch=master)](https://coveralls.io/github/emmanuelroecker/php-linkchecker?branch=master)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/4f63b147-1922-4527-9d0d-e369397a1c13/mini.png)](https://insight.sensiolabs.com/projects/4f63b147-1922-4527-9d0d-e369397a1c13)\n\nCheck broken links in html / json files, sitemap.xml, markdown and robots.txt.\n\nIt's working with :\n\n*   [Guzzle](http://docs.guzzlephp.org)\n*   [Symfony Finder Component](http://symfony.com/doc/2.3/components/finder.html)\n*   [Glicer Simply-html Component](https://github.com/emmanuelroecker/php-simply-html)\n\n## Installation\n\nThis library can be found on [Packagist](https://packagist.org/packages/glicer/link-checker).\n\nThe recommended way to install is through [composer](http://getcomposer.org).\n\nEdit your `composer.json` and add :\n\n```json\n{\n    \"require\": {\n       \"glicer/link-checker\": \"dev-master\"\n    }\n}\n```\n\nInstall dependencies :\n\n```bash\nphp composer.phar install\n```\n\n## How to check links in html / json files ?\n\n```php\nrequire 'vendor/autoload.php';\n\nuse GlLinkChecker\\GlLinkChecker;\nuse GlLinkChecker\\GlLinkCheckerReport;\nuse Symfony\\Component\\Finder\\Finder;\n\n//relative url use host http://lyon.glicer.com to check link\n$linkChecker  = new GlLinkChecker('http://lyon.glicer.com');\n\n//construct list of local html and json files to check\n$finder = new Finder();\n$files  = $finder-\u003efiles()-\u003ein('./public')-\u003ename(\"*.html\")-\u003ename(\"*.json\");\n\n//launch links checking\n$result  = $linkChecker-\u003echeckFiles(\n    $files,\n    function ($nbr) {\n        // called at beginning - $nbr urls to check\n    },\n    function ($url, $files) {\n        // called each $url - $files : list of filename containing $url link\n    },\n    function () {\n        // called at the end\n    }\n);\n\n//convert $result array in a temp html file\n$filereport = GlLinkCheckerReport::toTmpHtml('lyonCheck',$result);\n\n//$filereport contain fullpath to html file\nprint_r($filereport);\n```\n\nyou can view $filereport with your browser\n\n## How to check links in robots.txt and sitemap files ?\n\n```php\nrequire 'vendor/autoload.php';\n\nuse GlLinkChecker\\GlLinkChecker;\n\n$linkChecker = new GlLinkChecker('http://lyon.glicer.com');\n$result      = $linkChecker-\u003echeckRobotsSitemap();\n\nprint_r($result);\n```\n\nGlLinkChecker::checkRobotsSitemap() return an array like :\n\n```php\n$result = [\n    'disallow' =\u003e\n        ['error' =\u003e ['/img/', '/download/']],\n    'sitemap'  =\u003e\n        [\n            'ok' =\u003e [\n                '/sitemap.xml' =\u003e\n                    [\n                        'ok' =\u003e\n                            [\n                                '/index.html',\n                                '/section/probleme-solution/compresser-css-html-js.html'\n                            ]\n                    ]\n            ]\n        ]\n];\n```\n\n## Running Tests\n\nLaunch from command line :\n\n```console\nvendor\\bin\\phpunit\n```\n\n## License MIT\n\n## Contact\n\nAuthors : Emmanuel ROECKER \u0026 Rym BOUCHAGOUR\n\n[Web Development Blog - http://dev.glicer.com](http://dev.glicer.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmanuelroecker%2Fphp-linkchecker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmanuelroecker%2Fphp-linkchecker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmanuelroecker%2Fphp-linkchecker/lists"}