]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Photo.php
Improved documentation, now checking all items
[friendica.git] / src / Model / Photo.php
index 445e8a5e5c98663b5d5f7add9552f3cca44f7d4f..c4dbf2b30a1f53eda14d089cf2e8eb6da2babfad 100644 (file)
@@ -6,7 +6,6 @@
  */
 namespace Friendica\Model;
 
-use Friendica\BaseObject;
 use Friendica\Core\Cache;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
@@ -29,7 +28,7 @@ require_once "include/dba.php";
 /**
  * Class to handle photo dabatase table
  */
-class Photo extends BaseObject
+class Photo
 {
        /**
         * @brief Select rows from the photo table and returns them as array
@@ -457,12 +456,12 @@ class Photo extends BaseObject
 
                        $suffix = "?ts=" . time();
 
-                       $image_url = System::baseUrl() . "/photo/" . $resource_id . "-4." . $Image->getExt() . $suffix;
-                       $thumb = System::baseUrl() . "/photo/" . $resource_id . "-5." . $Image->getExt() . $suffix;
-                       $micro = System::baseUrl() . "/photo/" . $resource_id . "-6." . $Image->getExt() . $suffix;
+                       $image_url = DI::baseUrl() . "/photo/" . $resource_id . "-4." . $Image->getExt() . $suffix;
+                       $thumb = DI::baseUrl() . "/photo/" . $resource_id . "-5." . $Image->getExt() . $suffix;
+                       $micro = DI::baseUrl() . "/photo/" . $resource_id . "-6." . $Image->getExt() . $suffix;
 
                        // Remove the cached photo
-                       $a = \get_app();
+                       $a = DI::app();
                        $basepath = $a->getBasePath();
 
                        if (is_dir($basepath . "/photo")) {
@@ -488,9 +487,9 @@ class Photo extends BaseObject
                }
 
                if ($photo_failure) {
-                       $image_url = System::baseUrl() . "/images/person-300.jpg";
-                       $thumb = System::baseUrl() . "/images/person-80.jpg";
-                       $micro = System::baseUrl() . "/images/person-48.jpg";
+                       $image_url = DI::baseUrl() . "/images/person-300.jpg";
+                       $thumb = DI::baseUrl() . "/images/person-80.jpg";
+                       $micro = DI::baseUrl() . "/images/person-48.jpg";
                }
 
                return [$image_url, $thumb, $micro];
@@ -623,7 +622,7 @@ class Photo extends BaseObject
                }
 
                foreach ($images as $image) {
-                       if (!stristr($image, System::baseUrl() . '/photo/')) {
+                       if (!stristr($image, DI::baseUrl() . '/photo/')) {
                                continue;
                        }
                        $image_uri = substr($image,strrpos($image,'/') + 1);
@@ -680,8 +679,7 @@ class Photo extends BaseObject
         */
        public static function getGUID($name)
        {
-               $a = \get_app();
-               $base = $a->getBaseURL();
+               $base = DI::baseUrl()->get();
 
                $guid = str_replace([Strings::normaliseLink($base), '/photo/'], '', Strings::normaliseLink($name));
 
@@ -726,8 +724,7 @@ class Photo extends BaseObject
         */
        public static function isLocalPage($name)
        {
-               $a = \get_app();
-               $base = $a->getBaseURL();
+               $base = DI::baseUrl()->get();
 
                $guid = str_replace(Strings::normaliseLink($base), '', Strings::normaliseLink($name));
                $guid = preg_replace("=/photos/.*/image/(.*)=ism", '$1', $guid);