Check Source Code links
Introduction
The check source URLs module is to review the source code in a module or a directory to find any broken links.
When the module is first installed it obtains a list of top level domains from
http://data.iana.org/TLD/tlds-alpha-by-domain.txt
To review a module a dev task has been created which can be run to check urls in the source code of
php, JavaScript, SilverStripe templates and MarkDown files.
It need the php module curl to be installed and it records all the suspected broken urls it finds in a table., (*1)
The list it returns can not be guaranteed but it gives a good indication of broken urls., (*2)
Maintainer Contact
* Kirk Mayo kirk (at) silverstripe (dot) com
Requirements
* SilverStripe 3.0 +
Features
- Add a model admin for broken links
- Add a task to track source code broken links
Installation
- Download the module form GitHub (Composer support to be added)
- Extract the file (if you are on windows try 7-zip for extracting tar.gz files
- Make sure the folder after being extracted is named 'check-source-urls'
- Place this directory in your sites root directory. This is the one with framework and cms in it.
- Run in your browser -
/dev/build
to rebuild the database.
- You should see a new menu called Broken URLs
- Run the following task http://path.to.silverstripe/BrokenScriptsURLS?module=framework to check
the framework module for broken source code links
Dev task
Run the following task http://path.to.silverstripe/BrokenScriptsURLS?module=framework to check your site for
broken source code links.
To ignore certain directories add the param excludeDir=/directory/to/exclude as per the example below, (*3)
http://localhost/brokenURLs/dev/tasks/BrokenScriptsURLS?module=framework&excludeDir=framework/docs/en/changelogs, (*4)
Skipping Domains
By default certain domains are skipped like example.com and mysite.com to see or edit the full list view the
skipDomains property of the BrokenScriptsURL class in code/tasks/BrokenScriptsURLS.php, (*5)
Disable the Broken URL model admin
To disable the Broken URLs menu add the following code to mysite/_config.php, (*6)
CMSMenu::remove_menu_item('BrokenURLModelAdmin');
, (*7)
TODO
Add support for Punycode top level domains., (*8)
Add multi language support, (*9)