---
title: "Bugzilla Extension的开发"
author: "xmeteor"
date: "2012-10-12T11:57:25Z"
tags: []
categories: ["编程语言"]
slug: "bugzilla-extension"
draft: false
lastmod: "2012-10-12T11:57:25Z"
id: 1697035
url: "https://xmeteor.iteye.com/blog/1697035"
---

<http://www.bugzilla.org/docs/4.2/en/html/api/Bugzilla/Extension.html>

1. 创建一个extension的开发框架

```java
extensions/create.pl TEST
```


2. 程序的Hook写在extensions/TEST/Extension.pm里，有哪些Hook可以用，可参考下面的链接，或者参考extensions/Example/Extension.pm
<http://www.bugzilla.org/docs/4.2/en/html/api/Bugzilla/Hook.html#HOOKS>

3. 模板的Hook放到”extensions/Example/template/en/default/hook/“，模板Hook的命名方法

```java
<templates>/hook/<template path>/<template name>-<hook name>.<template type>.tmpl
```


4. 如需修改模板文件，请将修改过的模板文件copy到extension/template/... 目录下, 如果你的extenstion/template目录下有模板文件，Bugzilla将使用它替代系统的模板文件。

5. 执行命令 "./checksetup.pl" 安装extension