-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathadd_remove_hooks.php
More file actions
40 lines (36 loc) · 1.03 KB
/
add_remove_hooks.php
File metadata and controls
40 lines (36 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* This file is used to run database queries when installing
* a modification
*
* (c) Jason Clemons <jason@simplemachines.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Check to make sure SMF exists in this directory
*/
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
require_once(dirname(__FILE__) . '/SSI.php');
elseif (!defined('SMF'))
die('<strong>Error:</strong> Cannot install - please verify you put this in the same place as SMF\'s index.php.');
/**
* Define the hooks in an array
*
* Example:
* $hook_functions = array('integrate_actions', 'modification_actions');
*/
$hook_functions = array();
/**
* This determines whether we're installing or uninstalling
*/
if ($context['uninstall'])
$call = 'remove_integration_function';
else
$call = 'add_integration_function';
/**
* Execute the hook install/uninstall
*/
foreach ($hook_functions as $hook => $function)
$call($hook, $function);