* [Friends] Members can now apply to be added to the contact list.
[pivip.git] / project / library / Pivip / Module / Abstract.php
blobdca133eac8080b23b1074e551c4231500831de47
1 <?php
3 /**
4 * Pivip
5 * Copyright (C) 2008 Vincent Tunru
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20 * @license http://www.fsf.org/licensing/licenses/info/GPLv2.html GPL v.2
21 * @category Pivip
22 * @package Pivip
23 * @copyright (C) 2008 Vincent Tunru
24 * @author Vincent Tunru <email@vincentt.org>
27 /**
28 * Modules can extend this to provide an interface to the module
30 abstract class Pivip_Module_Abstract implements Pivip_Module_Interface
32 /**
33 * A list of required modules and their versions
35 * The module should define minimum and maximum versions, using
36 * array('module' => array('min' => 0.0.0dev', 'max' => '3.1.1'));
38 * @var array
40 protected $_dependencies;
42 /**
43 * Install the module (prepare the database, mark installed status, ...)
45 * @throws Pivip_Install_Exception
46 * @return boolean Whether the installation succeeded
48 public function install()
52 /**
53 * Uninstall the module (remove database values, ...)
55 * @throws Pivip_Install_Exception
56 * @return boolean Whether uninstallation succeeded
58 public function uninstall()
62 /**
63 * Check whether the module's API dependencies are available
65 * @throws Pivip_Install_Exception
66 * @return boolean True if API dependencies are met.
68 public function checkDependencies()
72 /**
73 * Load the module
75 public function bootstrap()
79 /**
80 * Allows child classes to push a request onto the stack
82 * @param Zend_Controller_Request_Abstract $request The request to push.
84 protected static function _pushStack(Zend_Controller_Request_Abstract $request)
86 $frontController = Zend_Controller_Front::getInstance();
87 $actionStack = $frontController
88 ->getPlugin('Zend_Controller_Plugin_ActionStack');
89 if(!$actionStack)
91 $actionStack = new Zend_Controller_Plugin_ActionStack();
92 $frontController->registerPlugin($actionStack);
94 $actionStack->pushStack($request);