]> git.mxchange.org Git - friendica.git/commitdiff
Adding performance measuring to the photo functions.
authorMichael Vogel <icarus@dabo.de>
Sat, 7 Mar 2015 20:07:26 +0000 (21:07 +0100)
committerMichael Vogel <icarus@dabo.de>
Sat, 7 Mar 2015 20:07:26 +0000 (21:07 +0100)
include/Photo.php

index 2f7c990256c392b7f00d083b49075b70f9d332f2..ccb6af29e92c22447a715e9d41c4483cd8501b99 100644 (file)
@@ -516,7 +516,12 @@ class Photo {
            return FALSE;
 
        $string = $this->imageString();
+
+       $a = get_app();
+
+       $stamp1 = microtime(true);
        file_put_contents($path, $string);
+       $a->save_timestamp($stamp1, "file");
     }
 
     public function imageString() {
@@ -767,7 +772,12 @@ function get_photo_info($url) {
                $filesize = strlen($img_str);
 
                $tempfile = tempnam(get_temppath(), "cache");
+
+               $a = get_app();
+               $stamp1 = microtime(true);
                file_put_contents($tempfile, $img_str);
+               $a->save_timestamp($stamp1, "file");
+
                $data = getimagesize($tempfile);
                unlink($tempfile);
 
@@ -851,7 +861,10 @@ function store_photo($a, $uid, $imagedata = "", $url = "") {
                return(array());
        } elseif (strlen($imagedata) == 0) {
                logger("Uploading picture from ".$url, LOGGER_DEBUG);
+
+               $stamp1 = microtime(true);
                $imagedata = @file_get_contents($url);
+               $a->save_timestamp($stamp1, "file");
        }
 
        $maximagesize = get_config('system','maximagesize');
@@ -875,7 +888,11 @@ function store_photo($a, $uid, $imagedata = "", $url = "") {
 */
 
        $tempfile = tempnam(get_temppath(), "cache");
+
+       $stamp1 = microtime(true);
        file_put_contents($tempfile, $imagedata);
+       $a->save_timestamp($stamp1, "file");
+
        $data = getimagesize($tempfile);
 
        if (!isset($data["mime"])) {