Gallery2:Design Documents:Module Requirements Framework - Gallery Codex
Personal tools

Gallery2:Design Documents:Module Requirements Framework

From Gallery Codex

This document describes a high-level overview of a proposed feature. More details are needed before implementation.

Naming: requirements, dependencies


The Module Requirements Framework would provide a centralized means to query modules' requirements for proper functioning. Currently, each module checks its own requirements before activation, which leads to a lot of code and string duplication, increasing the maintenance overhead and making the translators' jobs somewhat harder. It would also simplify and speed up module development.

It would work as a module callback function called by the core module during activation or installation that would supply a list of requirements that the module needs. The core module would then check each requirement and in case of failure provide a UI with an explanation to the user. If modules need a specific check not covered in the core module, they could do the check on their own, but use the framework to provide an UI consistent with the other checks.

Current modules would have to be reworked to make use of this framework.

Use Cases

  • Check for availability of PHP functions, such as exec(); useful for toolkits, archive modules, etc.
  • Check for other G2 plugins (plugin that depends on other plugins (with plugin version). See xaraya which has a very good dependency framework.
  • Check if certain PHP modules are present, e.g. GD (note: usually checked by checking if any function of the PHP extension exists)
  • Check if a certain version of Apache module is installed, e.g. Rewrite 1.0.2, for permalinks or URL rewrite
  • Check for G2 toolkit operation / property + mime-type availability.
  •  ?