Gallery: 设计文档:模块需求框架:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
无编辑摘要
 
第1行: 第1行:
This document describes a high-level overview of a proposed feature. More details are needed before implementation.
该文档为某被提议特点的高层次概览。在实现之前需要更详细的信息。


Naming: requirements, dependencies
命名:需求,依赖性


== Overview ==
== 概览 ==
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.
模块需求框架(Module Requirements Framework)提供集中措施,以正常运行为目标进行模块需求的查询。目前,各模块在激活钱都会检查各自的需求,结果就是增加了代码及字串复制量,增加了后续维护的工作量并使得翻译者的工作难度增大。而模块需求框架则能简化并加速模块的开发。


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.
它将作为一个被核心模块呼叫的模块callback函数而运行,在激活或安装时针对模块所需,提供模块需求列表。接着核心模块就会检查各需求项,一旦出现失败情况就会提供一种UI对用户作出解释。如果模块需要的特定检查没有被核心模块所涵盖,它们就能进行自我检查,但使用框架来提供一个与其他检查一致的UI。


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.
* 检查PHP函数的可用性,如exec(); 对于toolkits,archive都很有用。
* Check for other G2 plugins (plugin that depends on other plugins (with plugin version). See xaraya which has a very good dependency framework.
* 检查其他G2插件(以来其他插件的插件)。参见xaraya,它具有不错依赖性的框架。
* Check if certain PHP modules are present, e.g. GD (note: usually checked by checking if any function of the PHP extension exists)
* 检查某些PHP模块是否存在,如GD(注:通常通过检查PHP扩展的函数是否存在进行检查)
* Check if a certain version of Apache module is installed, e.g. Rewrite 1.0.2, for permalinks or URL rewrite
* 检查是否安装了某版本的Apache模块,如针对永久链接或URL重写的Rewrite 1.0.2
* Check for G2 toolkit operation / property + mime-type availability.
* 检查G2工具包运行/属性 + mime-type可用性。
* ?
* ?




[[Category:Gallery 2:Development|Developers]]
[[Category:Gallery 2:Development|Developers]]

2008年11月25日 (二) 15:30的最新版本

该文档为某被提议特点的高层次概览。在实现之前需要更详细的信息。

命名:需求,依赖性

概览[ ]

模块需求框架(Module Requirements Framework)提供集中措施,以正常运行为目标进行模块需求的查询。目前,各模块在激活钱都会检查各自的需求,结果就是增加了代码及字串复制量,增加了后续维护的工作量并使得翻译者的工作难度增大。而模块需求框架则能简化并加速模块的开发。

它将作为一个被核心模块呼叫的模块callback函数而运行,在激活或安装时针对模块所需,提供模块需求列表。接着核心模块就会检查各需求项,一旦出现失败情况就会提供一种UI对用户作出解释。如果模块需要的特定检查没有被核心模块所涵盖,它们就能进行自我检查,但使用框架来提供一个与其他检查一致的UI。

目前的模块需要返工以使用这种框架。

使用情况[ ]

  • 检查PHP函数的可用性,如exec(); 对于toolkits,archive都很有用。
  • 检查其他G2插件(以来其他插件的插件)。参见xaraya,它具有不错依赖性的框架。
  • 检查某些PHP模块是否存在,如GD(注:通常通过检查PHP扩展的函数是否存在进行检查)
  • 检查是否安装了某版本的Apache模块,如针对永久链接或URL重写的Rewrite 1.0.2
  • 检查G2工具包运行/属性 + mime-type可用性。
  • ?