]> git.mxchange.org Git - friendica.git/blobdiff - include/plugin.php
Merge remote-tracking branch 'upstream/master'
[friendica.git] / include / plugin.php
index ef0ddd05ef108c41c482b2b365ac970cd79c85fb..9795cacf92019116a439edee50ef28faca5713c3 100644 (file)
@@ -8,7 +8,7 @@ function uninstall_plugin($plugin){
        q("DELETE FROM `addon` WHERE `name` = '%s' ",
                dbesc($plugin)
        );
-    
+
        @include_once('addon/' . $plugin . '/' . $plugin . '.php');
        if(function_exists($plugin . '_uninstall')) {
                $func = $plugin . '_uninstall';
@@ -28,9 +28,9 @@ function install_plugin($plugin) {
        if(function_exists($plugin . '_install')) {
                $func = $plugin . '_install';
                $func();
-               
+
                $plugin_admin = (function_exists($plugin."_plugin_admin")?1:0);
-               
+
                $r = q("INSERT INTO `addon` (`name`, `installed`, `timestamp`, `plugin_admin`) VALUES ( '%s', 1, %d , %d ) ",
                        dbesc($plugin),
                        intval($t),
@@ -158,6 +158,8 @@ function load_hooks() {
 
 if(! function_exists('call_hooks')) {
 function call_hooks($name, &$data = null) {
+       $stamp1 = microtime(true);
+
        $a = get_app();
 
        if((is_array($a->hooks)) && (array_key_exists($name,$a->hooks))) {
@@ -181,7 +183,6 @@ function call_hooks($name, &$data = null) {
                        }
                }
        }
-
 }}
 
 
@@ -199,18 +200,24 @@ function call_hooks($name, &$data = null) {
 
 if (! function_exists('get_plugin_info')){
 function get_plugin_info($plugin){
+
+       $a = get_app();
+
        $info=Array(
                'name' => $plugin,
                'description' => "",
                'author' => array(),
                'version' => ""
        );
-       
+
        if (!is_file("addon/$plugin/$plugin.php")) return $info;
-       
+
+       $stamp1 = microtime(true);
        $f = file_get_contents("addon/$plugin/$plugin.php");
+       $a->save_timestamp($stamp1, "file");
+
        $r = preg_match("|/\*.*\*/|msU", $f, $m);
-       
+
        if ($r){
                $ll = explode("\n", $m[0]);
                foreach( $ll as $l ) {
@@ -230,10 +237,10 @@ function get_plugin_info($plugin){
                                                $info[$k]=$v;
                                        }
                                }
-                               
+
                        }
                }
-               
+
        }
        return $info;
 }}
@@ -242,7 +249,7 @@ function get_plugin_info($plugin){
 /*
  * parse theme comment in search of theme infos.
  * like
- *     
+ *
  *      * Name: My Theme
  *   * Description: My Cool Theme
  *      * Version: 1.2.3
@@ -270,11 +277,14 @@ function get_theme_info($theme){
                $info['unsupported'] = true;
 
        if (!is_file("view/theme/$theme/theme.php")) return $info;
-       
+
+       $a = get_app();
+       $stamp1 = microtime(true);
        $f = file_get_contents("view/theme/$theme/theme.php");
+       $a->save_timestamp($stamp1, "file");
+
        $r = preg_match("|/\*.*\*/|msU", $f, $m);
-       
-       
+
        if ($r){
                $ll = explode("\n", $m[0]);
                foreach( $ll as $l ) {