urisavka/site-checker

Check site for broken links and moved/deleted files

1.0.0 2016-01-21 15:34 UTC

This package is not auto-updated.

Last update: 2024-04-13 15:50:35 UTC


README

Build Status Scrutinizer Code Quality SensioLabsInsight

Recursively checks site for broken links, missing images, css and javascript files starting from giving URL and discovering all links on pages.

Installation

For console usage

git clone git@github.com:urisavka/site-checker.git && cd site-checker && composer update --no-dev

For usage in a project

composer require urisavka/site-checker

Configuration

Copy config/app.json.default into config/app.json and add whatever you want there.

You could also specify custom cookies to be sent with request.

Excluded URLs can be defined as regular expressions in PCRE format. Use excludedUrls option.

You may also include set of custom included Urls that are not accessible from your home page. Use includedUrls option.

If you define reportEmail parameter, email will be sent after checking with a list of broken links (if any). You can also define reportEMailFrom value to set From: field for your emails.

See config/app.json.default for example.

Usage

Console tool: sitechecker [-e|--check-external] [-s|--log-success] [-f|--full-html] [--] <site>

From your code:

$siteChecker = SiteChecker::create();
$siteChecker->check('http://gooogle.com');
$results = $siteChecker->getResults();

See CheckCommand and ConsoleObserver for real usage.