diff options
author | Fabio Comuni <fabrix.xm@gmail.com> | 2012-02-13 09:46:42 +0100 |
---|---|---|
committer | Fabio Comuni <fabrix.xm@gmail.com> | 2012-02-13 09:46:42 +0100 |
commit | 850560519a4bbe9949368933e115f767aeb90b73 (patch) | |
tree | 6f162b4b0130a5f829d40f7ebd9d18442ad18921 /include/plugin.php | |
parent | 16d3bc9deb5cb80f438a53f1bf483c79351674af (diff) | |
parent | 85c831bcbf6f4cc2793d91e4e3fb3da5828a3f60 (diff) | |
download | volse-hubzilla-850560519a4bbe9949368933e115f767aeb90b73.tar.gz volse-hubzilla-850560519a4bbe9949368933e115f767aeb90b73.tar.bz2 volse-hubzilla-850560519a4bbe9949368933e115f767aeb90b73.zip |
Merge remote-tracking branch 'friendica/master' into mobile
Diffstat (limited to 'include/plugin.php')
-rwxr-xr-x | include/plugin.php | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/include/plugin.php b/include/plugin.php index fe325ac3b..85b51edff 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -56,25 +56,29 @@ function reload_plugins() { if(count($parr)) { foreach($parr as $pl) { $pl = trim($pl); + + $fname = 'addon/' . $pl . '/' . $pl . '.php'; - $t = filemtime('addon/' . $pl . '/' . $pl . '.php'); - foreach($installed as $i) { - if(($i['name'] == $pl) && ($i['timestamp'] != $t)) { - logger('Reloading plugin: ' . $i['name']); - @include_once('addon/' . $pl . '/' . $pl . '.php'); - - if(function_exists($pl . '_uninstall')) { - $func = $pl . '_uninstall'; - $func(); - } - if(function_exists($pl . '_install')) { - $func = $pl . '_install'; - $func(); + if(file_exists($fname)) { + $t = @filemtime($fname); + foreach($installed as $i) { + if(($i['name'] == $pl) && ($i['timestamp'] != $t)) { + logger('Reloading plugin: ' . $i['name']); + @include_once($fname); + + if(function_exists($pl . '_uninstall')) { + $func = $pl . '_uninstall'; + $func(); + } + if(function_exists($pl . '_install')) { + $func = $pl . '_install'; + $func(); + } + q("UPDATE `addon` SET `timestamp` = %d WHERE `id` = %d LIMIT 1", + intval($t), + intval($i['id']) + ); } - q("UPDATE `addon` SET `timestamp` = %d WHERE `id` = %d LIMIT 1", - intval($t), - intval($i['id']) - ); } } } |