chore: add global definitions for paths to simplify includes#694
chore: add global definitions for paths to simplify includes#694
Conversation
User Test ResultsTest specification and instructions User tests are not required |
| # Also exclude testing locales for each link: 'lang=*' | ||
| builder_echo blue "---- Testing links" | ||
| npx broken-link-checker http://localhost:8053/_test --recursive --ordered ---host-requests 50 -e --filter-level 3 --exclude '*/donate' --exclude '*lang=*' | tee blc.log | ||
| npx broken-link-checker http://localhost:8053/_test --recursive --ordered ---host-requests 50 -e --filter-level 3 --exclude '*/donate' --exclude='/downloads/releases/*' --exclude '*lang=*' | tee blc.log |
There was a problem hiding this comment.
Skipping the /downloads/releases/ paths shortcuts a lot of tests. There's a risk there if we change those pages of course.
There was a problem hiding this comment.
Do we adjust the link checker in the GHA too?
keyman.com/.github/workflows/ci.yml
Lines 40 to 45 in 947c553
There was a problem hiding this comment.
Do we adjust the link checker in the GHA too?
I'll do that as a separate PR, perhaps. In some ways it's better to keep the separate one.
I saw something that concerned me with the link checker -- it seemed to continue to operate with pages with server errors. I will have to review to make sure we aren't missing those.
Adds _includes/prepended_header.php which defines `_KEYMANCOM_INCLUDES` and `_KEYMANCOM_COMMON`, which are then available to every .php page on the site. Fixed up all `require`/`require_once` references to use the appropriate defines consistently. There remain some `require_once` references that do not link `_KEYMANCOM_*` -- these are for other files that are not under either of those include folders. Test-bot: skip
6d3345a to
d591cc4
Compare
| # Also exclude testing locales for each link: 'lang=*' | ||
| builder_echo blue "---- Testing links" | ||
| npx broken-link-checker http://localhost:8053/_test --recursive --ordered ---host-requests 50 -e --filter-level 3 --exclude '*/donate' --exclude '*lang=*' | tee blc.log | ||
| npx broken-link-checker http://localhost:8053/_test --recursive --ordered ---host-requests 50 -e --filter-level 3 --exclude '*/donate' --exclude='/downloads/releases/*' --exclude '*lang=*' | tee blc.log |
There was a problem hiding this comment.
Do we adjust the link checker in the GHA too?
keyman.com/.github/workflows/ci.yml
Lines 40 to 45 in 947c553
Adds _includes/prepended_header.php which defines
_KEYMANCOM_INCLUDESand_KEYMANCOM_COMMON, which are then available to every .php page on the site.Fixed up all
require/require_oncereferences to use the appropriate defines consistently. There remain somerequire_oncereferences that do not link_KEYMANCOM_*-- these are for other files that are not under either of those include folders.Note: regex
(require_once|require|include|include_once)\b(?! _KEYMANCOM)will find allinclude/require[_once]references (and a few irrelevancies). Removing the local refs (e.g. tosession.phpinkeyboards/) leaves the following files which don't use these paths and could be further cleaned up in a future PR -- but these are low priority and low risk:Test-bot: skip