5 * Provides an base class for a plugin
7 * This file is copyright (c) Roland Mas <lolando@debian.org>, 2002
11 * This file is part of GForge.
13 * GForge is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * GForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with GForge; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 class Plugin extends Error {
33 * Plugin() - constructor
39 $this->hooks = array () ;
43 * GetHooks() - get list of hooks to subscribe to
45 * @return List of strings
47 function GetHooks () {
52 * GetName() - get plugin name
54 * @return the plugin name
61 * GetInstallDir() - get installation dir for the plugin
63 * @return the directory where the plugin should be linked.
65 function GetInstallDir () {
66 if (isset($this->installdir) && $this->installdir)
67 return $this->installdir;
69 return 'plugins/'.$this->name ;
73 * CallHook() - call a particular hook
75 * @param hookname - the "handle" of the hook
76 * @param params - array of parameters to pass the hook
78 function CallHook ($hookname, $params) {
86 // c-file-style: "bsd"