]> git.mxchange.org Git - friendica.git/commitdiff
bug #274
authorfriendica <info@friendica.com>
Fri, 10 Feb 2012 06:44:59 +0000 (22:44 -0800)
committerfriendica <info@friendica.com>
Fri, 10 Feb 2012 06:44:59 +0000 (22:44 -0800)
include/plugin.php

index fe325ac3b0db0a20428aa8ecf21666cfdd0ba471..85b51edff506c5378db13f8fd8caf939a6e33c0e 100755 (executable)
@@ -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'])
-                                               );
                                        }
                                }
                        }