$globals->db->query("update envoidirect set date_succes=NOW() where matricule = $matricule");
require_once("xorg.hook.inc.php");
-$hook = new XOrgHook('core');
+$hook = new XOrgHook();
$hook->subscribe($forlife, $uid, $promo, $password, true);
start_connexion($uid,false);
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
**************************************************************************/
-require_once("PEAR.php");
-
// {{{ class XOrgHook
/**
* @link http://doc.polytechnique.org/XOrgModule/#hook
* @since Classe available since 0.9.3
*/
-class XOrgHook extends PEAR
+class XOrgHook
{
// {{{ properties
/**
- * holds the name of the hook we want to run.
- *
- * @var string
- m @access private
- */
- var $_name;
-
- /**
* list of all the modules names that have implemented some reactions to our triggers
*
* @var array
*
* @param string $name the name of the hook
*/
- function XOrgHook($name)
+ function XOrgHook()
{
global $globals;
- $this->PEAR();
- if (!file_exists($globals->root."/hooks/$name/API")) {
- $this->raiseError("The hook « $name » do not exists, or is undocumented",1,PEAR_ERROR_DIE);
- }
- foreach (glob($globals->root."/hooks/$name/*.inc.php") as $file) {
+ foreach (glob($globals->root."/hooks/*.inc.php") as $file) {
require_once("$file");
$this->_mods[] = basename($file, '.inc.php');
}
function __call($function, $arguments, &$return)
{
if ( ($i = count($arguments) - 1) < 0) {
- $this->raiseError("In the Hook « {$this->_name} » the function « $function » expects at least 1 argument");
+ $this->raiseError("The hook « $function » expects at least 1 argument");
}
foreach ($this->_mods as $mod) {
if (!function_exists($mod.'_'.$function)) continue;