New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different approach for extension check, refs 4119, 4190 #4438
Conversation
@kghbln As outlined above, the error code (e.g [0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/bcb2bd17d70f2b296e54e43028cd7e0b39139a8b/data/template/setupcheck/setupcheck.json |
An upcoming PR will add |
As for the mentioned codes, [0] contains a short description for each of them. [0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/src/SetupCheck.php#L20-L60 |
I started to add some rudimentary information in [0]. [0] https://www.semantic-mediawiki.org/wiki/Help:Setup_check |
This PR is made in reference to: #
This PR addresses or contains:
When
SetupCheck
was introduced as part of #4041 and extended in #4119, #4190 the class became increasingly convoluted with different HTML snippets to create a meaningful error message to the user. The HTML code has been "outsourced" to templates with the definition of what should be generated now being defined bysetupcheck.json
with the following errors keys:ERROR_EXTENSION_LOAD
ERROR_EXTENSION_INVALID_ACCESS
ERROR_EXTENSION_REGISTRY
ERROR_EXTENSION_DEPENDENCY
ERROR_EXTENSION_DEPENDENCY_MULTIPLE
ERROR_EXTENSION_INCOMPATIBLE
ERROR_SCHEMA_INVALID_KEY
, andMAINTENANCE_MODE
There was also a mix of MW message keys and canonical text making the handling inconsistent in case SMW wasn't loaded those MW keys couldn't be used therefore to avoid cluttering text representations,
setupcheck.i18n.json
now contains keys and translatable text that is independent of the state of MW and SMW.#4190 added a check for
wfLoadExtension( 'SemanticMediaWiki' )
to detect "doubly" invocation but made it dependent to callExtensionRegistry::getInstance
and left a certain use case uncovered #4190#issuecomment-517948006 making the solution sub-optimal. Instead of relying onExtensionRegistry
we'll register aUncaughtExceptionHandler
and inspect those errors we are interested in and make them to look "nice" with some extra context. This also provides us with a means to the fetch additional errors (ERROR_EXTENSION_DEPENDENCY
,ERROR_EXTENSION_INCOMPATIBLE
etc.) that would otherwise be displayed as "ugly" exception without any context.This PR includes:
Examples