编辑“Gallery:设计文档:模块需求框架

跳转至: 导航、​ 搜索
警告:您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您登录创建一个账户,您的编辑将归属于您的用户名,且将享受其他好处。

该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。

最后版本 您的文本
第1行: 第1行:
该文档为某被提议特点的高层次概览。在实现之前需要更详细的信息。
This document describes a high-level overview of a proposed feature. More details are needed before implementation.


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


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


它将作为一个被核心模块呼叫的模块callback函数而运行,在激活或安装时针对模块所需,提供模块需求列表。接着核心模块就会检查各需求项,一旦出现失败情况就会提供一种UI对用户作出解释。如果模块需要的特定检查没有被核心模块所涵盖,它们就能进行自我检查,但使用框架来提供一个与其他检查一致的UI。
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 ==
* 检查PHP函数的可用性,如exec(); 对于toolkits,archive都很有用。
* Check for availability of PHP functions, such as exec(); useful for toolkits, archive modules, etc.
* 检查其他G2插件(以来其他插件的插件)。参见xaraya,它具有不错依赖性的框架。
* Check for other G2 plugins (plugin that depends on other plugins (with plugin version). See xaraya which has a very good dependency framework.
* 检查某些PHP模块是否存在,如GD(注:通常通过检查PHP扩展的函数是否存在进行检查)
* Check if certain PHP modules are present, e.g. GD (note: usually checked by checking if any function of the PHP extension exists)
* 检查是否安装了某版本的Apache模块,如针对永久链接或URL重写的Rewrite 1.0.2
* Check if a certain version of Apache module is installed, e.g. Rewrite 1.0.2, for permalinks or URL rewrite
* 检查G2工具包运行/属性 + mime-type可用性。
* Check for G2 toolkit operation / property + mime-type availability.
* ?
* ?




[[Category:Gallery 2:Development|Developers]]
[[Category:Gallery 2:Development|Developers]]
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅Wordpress-mediawiki:版权的细节)。 未经许可,请勿提交受版权保护的作品!
取消 编辑帮助(在新窗口中打开)