exp:expurltest
Test a URL map against a running site: request every old address, follow the redirects and compare where it lands with the new_url.
Script bin/php/expurltest.php, code in kernel/private/classes/commands/expurltest.php. Run it from the installation root, as the user the web server runs as:
./console exp:expurltest --help
./console exp:url:test --help
php bin/php/expurltest.php --helpHelp text
Test a URL map against a running site
Requests every old address of the map on --base, several at a time, follows the redirects and
compares where it lands with the row's new_url: landed, wrong-status (permanent where a temporary
redirect was expected, or the other way), wrong-target, not-redirected, error; rows without a
new_url are skipped. A wildcard row is tested with a sample for its *. Ends with exit 1 when a row did
not land. Node targets (node:<id>) are compared with the node's address on the siteaccess of -s.
./console exp:url:test var/tmp/map.csv --base=https://www.example.com
./console exp:url:test var/tmp/map.xlsx --base=https://staging.example.com --insecure --report=var/tmp/test.csv
./console exp:url:test var/tmp/map.csv --base=https://www.example.com --concurrency=16 --format=jsonOptions
| Option | Value | Help |
|---|---|---|
--base | required | test: the site to test, https://www.example.com (needed) |
--format | required | import: the format of the file (csv, json, xlsx, ods, apache, nginx; default from its name or content); export: the format to write (default from --output, else csv); batches, undo, from-sitemap, from-404, suggest, test: text (default) or json (the machine output exp-url/1) |
--report | required | import: also write the plan, row by row, to this file (.json, or .csv); suggest, test: also write every row with its suggestions or its result to this file (.json, or .csv) |
--limit | required | batches: how many of the last imports to list (default 20); from-sitemap, from-404, test: the most rows (default all) |
--concurrency | required | test: the requests at the same time (default 8) |
--timeout | required | from-sitemap, test: the seconds a request may take (default 15) |
--max-redirects | required | test: the redirects followed before a row counts as an error (default 5) |
--insecure | from-sitemap, test: do not verify TLS certificates (for test hosts with a self-signed one) |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Arguments: [file].
Related
Generated by ./console exp:help:examples from bin/php/expurltest.php, kernel/private/classes/commands/expurltest.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.