spaze/url-checker
A command line tool to check URL HTTP code and contents.
Maintainers
v1.1.0
2026-02-15 00:51 UTC
Requires
None
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.0 || ^13.0
- spaze/coding-standard: ^1.9
- spaze/phpcs-phar: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT 5f11edf4866a80972867c37f8a3efa38d1b0dd90
This package is auto-updated.
Last update: 2026-06-20 14:02:14 UTC
README
A command line tool to check URL HTTP code and contents.
Install
composer create-project --no-dev spaze/url-checker url-checker
Usage
check.php <url> <expected_http_code> <required_text> <forbidden_text> [OPTIONS]
Options
--ignore-case-required-text: Ignore case when looking for the required text. Only ASCII case folding will be done, non-ASCII bytes will be compared by their byte value.--ignore-case-forbidden-text: Ignore case when looking for the forbidden text. Only ASCII case folding will be done, non-ASCII bytes will be compared by their byte value.
The checker sends a request to <url> and checks:
- If the HTTP status code matches
<expected_http_code> - If the page contains
<required_text> - If
<forbidden_text>is not present
Example
bin/check.php https://example.com 200 "required" "FAiLuRe" --ignore-case-forbidden-text
Exit codes
The exit code is
1if the status code doesn't match<expected_http_code>2if<required_text>is missing3if<forbidden_text>is found4if other runtime error occurs
