diff --git a/doc/changelog.txt b/doc/changelog.txt index dfa32411..04fdc898 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -1,3 +1,9 @@ +6.2 "" (released xx.xx.2011) + +Changes: +- checking: Parse PHP files recursively. + + 6.1 "Christmas Vacation" (released 23.12.2010) Fixes: diff --git a/linkcheck/checker/urlbase.py b/linkcheck/checker/urlbase.py index c62005f4..f889bd4c 100644 --- a/linkcheck/checker/urlbase.py +++ b/linkcheck/checker/urlbase.py @@ -77,6 +77,10 @@ class UrlBase (object): ContentMimetypes = { "text/html": "html", "application/xhtml+xml": "html", + # Include PHP file which helps when checking local .php files. + # It does not harm other URL schemes like HTTP since HTTP servers + # should not send this content type. They send text/html instead. + "application/x-httpd-php": "html", "text/css": "css", "application/x-shockwave-flash": "swf", "application/msword": "word", diff --git a/tests/checker/data/file.php b/tests/checker/data/file.php new file mode 100644 index 00000000..2e339c9e --- /dev/null +++ b/tests/checker/data/file.php @@ -0,0 +1 @@ +Bla diff --git a/tests/checker/data/file.php.result b/tests/checker/data/file.php.result new file mode 100644 index 00000000..9f28238e --- /dev/null +++ b/tests/checker/data/file.php.result @@ -0,0 +1,11 @@ +url file://%(curdir)s/%(datadir)s/file.php +cache key file://%(curdir)s/%(datadir)s/file.php +real url file://%(curdir)s/%(datadir)s/file.php +name %(datadir)s/file.php +valid + +url anchor.html +cache key file://%(curdir)s/%(datadir)s/anchor.html +real url file://%(curdir)s/%(datadir)s/anchor.html +name Bla +valid diff --git a/tests/checker/test_file.py b/tests/checker/test_file.py index ee897106..20c8f6c5 100644 --- a/tests/checker/test_file.py +++ b/tests/checker/test_file.py @@ -55,6 +55,9 @@ class TestFile (LinkCheckTest): def test_css (self): self.file_test("file.css") + def test_php (self): + self.file_test("file.php") + def test_urllist (self): self.file_test("urllist.txt")