Unneeded "ProxyUtils" renamed to "Proxy"
authorMichael <heluecht@pirati.ca>
Tue, 5 Oct 2021 20:18:19 +0000 (20:18 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 5 Oct 2021 20:18:19 +0000 (20:18 +0000)
src/Content/OEmbed.php
src/Content/Text/BBCode.php
src/Model/Contact.php
src/Model/Post/Media.php
src/Model/Profile.php
src/Model/User.php
src/Protocol/OStatus.php
src/Util/Proxy.php
src/Worker/ClearCache.php

index e97afdc483ba24e2cec69b1b7de8d10efa026dad..313a2628dbf5ea7f1fd01298c6df716975ddb73b 100644 (file)
@@ -35,7 +35,7 @@ use Friendica\DI;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Network;
 use Friendica\Util\ParseUrl;
-use Friendica\Util\Proxy as ProxyUtils;
+use Friendica\Util\Proxy;
 use Friendica\Util\Strings;
 
 /**
@@ -236,14 +236,14 @@ class OEmbed
                                break;
 
                        case "photo":
-                               $ret .= '<img width="' . $oembed->width . '" src="' . ProxyUtils::proxifyUrl($oembed->url) . '">';
+                               $ret .= '<img width="' . $oembed->width . '" src="' . Proxy::proxifyUrl($oembed->url) . '">';
                                break;
 
                        case "link":
                                break;
 
                        case "rich":
-                               $ret .= ProxyUtils::proxifyHtml($oembed->html);
+                               $ret .= Proxy::proxifyHtml($oembed->html);
                                break;
                }
 
index 87db9fb063d8e776d53fcaad1d63dc36a7b64de3..7328328e23fb6785166445a5b56536ca57d0a72d 100644 (file)
@@ -45,7 +45,7 @@ use Friendica\Protocol\Activity;
 use Friendica\Util\Images;
 use Friendica\Util\Map;
 use Friendica\Util\ParseUrl;
-use Friendica\Util\Proxy as ProxyUtils;
+use Friendica\Util\Proxy;
 use Friendica\Util\Strings;
 use Friendica\Util\XML;
 
@@ -470,7 +470,7 @@ class BBCode
                } elseif ($uriid > 0) {
                        return Post\Link::getByLink($uriid, $image, $size);
                } else {
-                       return ProxyUtils::proxifyUrl($image, $size);
+                       return Proxy::proxifyUrl($image, $size);
                }
        }
 
@@ -1059,9 +1059,9 @@ class BBCode
                                $attributes['profile']  = ($author_contact['url']   ?? '') ?: $attributes['profile'];
 
                                if (!empty($author_contact['id'])) {
-                                       $attributes['avatar'] = Contact::getAvatarUrlForId($author_contact['id'], ProxyUtils::SIZE_THUMB);
+                                       $attributes['avatar'] = Contact::getAvatarUrlForId($author_contact['id'], Proxy::SIZE_THUMB);
                                } elseif ($attributes['avatar']) {
-                                       $attributes['avatar'] = self::proxyUrl($attributes['avatar'], self::INTERNAL, $uriid, ProxyUtils::SIZE_THUMB);
+                                       $attributes['avatar'] = self::proxyUrl($attributes['avatar'], self::INTERNAL, $uriid, Proxy::SIZE_THUMB);
                                }
 
                                $content = preg_replace(Strings::autoLinkRegEx(), '<a href="$1">$1</a>', $match[3]);
index 1cff5a0c9c7105875215a867288c22e66d6bfd2d..83ca33639a2edfbebc83d62249dfae9ae1b2cd16 100644 (file)
@@ -1722,7 +1722,7 @@ class Contact
         * Get avatar link for given contact id
         *
         * @param integer $cid     contact id
-        * @param string  $size    One of the ProxyUtils::SIZE_* constants
+        * @param string  $size    One of the Proxy::SIZE_* constants
         * @param string  $updated Contact update date
         * @return string avatar link
         */
@@ -1764,7 +1764,7 @@ class Contact
         *
         * @param string  $url  contact url
         * @param integer $uid  user id
-        * @param string  $size One of the ProxyUtils::SIZE_* constants
+        * @param string  $size One of the Proxy::SIZE_* constants
         * @return string avatar link
         */
        public static function getAvatarUrlForUrl(string $url, int $uid, string $size = ''):string
@@ -1779,7 +1779,7 @@ class Contact
         * Get header link for given contact id
         *
         * @param integer $cid     contact id
-        * @param string  $size    One of the ProxyUtils::SIZE_* constants
+        * @param string  $size    One of the Proxy::SIZE_* constants
         * @param string  $updated Contact update date
         * @return string header link
         */
index 343dc8f0e05697ec10ae9d100a7e97acc006bc7c..b42ba89cf4957c66962d0ca9caa9afc6caa28a12 100644 (file)
@@ -686,7 +686,7 @@ class Media
         * Get preview link for given media id
         *
         * @param integer $id   media id
-        * @param string  $size One of the ProxyUtils::SIZE_* constants
+        * @param string  $size One of the Proxy::SIZE_* constants
         * @return string preview link
         */
        public static function getPreviewUrlForId(int $id, string $size = ''):string
@@ -716,7 +716,7 @@ class Media
         * Get media link for given media id
         *
         * @param integer $id   media id
-        * @param string  $size One of the ProxyUtils::SIZE_* constants
+        * @param string  $size One of the Proxy::SIZE_* constants
         * @return string media link
         */
        public static function getUrlForId(int $id, string $size = ''):string
index 361f1a7e4b20305fbb73180a010e4dfb352a1577..9987f86760090181156e359f3a058f1e563f3251 100644 (file)
@@ -41,7 +41,7 @@ use Friendica\Protocol\Diaspora;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\HTTPSignature;
 use Friendica\Util\Network;
-use Friendica\Util\Proxy as ProxyUtils;
+use Friendica\Util\Proxy;
 use Friendica\Util\Strings;
 
 class Profile
@@ -441,7 +441,7 @@ class Profile
                        $p['address'] = BBCode::convertForUriId($profile['uri-id'] ?? 0, $p['address']);
                }
 
-               $p['photo'] = Contact::getAvatarUrlForId($cid, ProxyUtils::SIZE_SMALL);
+               $p['photo'] = Contact::getAvatarUrlForId($cid, Proxy::SIZE_SMALL);
 
                $p['url'] = Contact::magicLinkById($cid, $profile['url']);
 
index 3178b888e7c03fa90378cc047f4900fe1e74d2ab..e27a950adb57f609039f93e7ad5b5ff85f16d446 100644 (file)
@@ -844,7 +844,7 @@ class User
         * Get avatar link for given user
         *
         * @param array  $user
-        * @param string $size One of the ProxyUtils::SIZE_* constants
+        * @param string $size One of the Proxy::SIZE_* constants
         * @return string avatar link
         * @throws Exception
         */
index b41b9a0678e34139c6279b0e5fb38969ccedc1a8..7e17ab9f98e5179c5b23d0a9e40cd4462a2a2f1d 100644 (file)
@@ -42,7 +42,7 @@ use Friendica\Network\HTTPClientOptions;
 use Friendica\Network\Probe;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Images;
-use Friendica\Util\Proxy as ProxyUtils;
+use Friendica\Util\Proxy;
 use Friendica\Util\Strings;
 use Friendica\Util\XML;
 
@@ -1193,7 +1193,7 @@ class OStatus
                        }
 
                        // Is it a remote picture? Then make a smaller preview here
-                       $preview = Post\Link::getByLink($uriid, $preview, ProxyUtils::SIZE_SMALL);
+                       $preview = Post\Link::getByLink($uriid, $preview, Proxy::SIZE_SMALL);
 
                        // Is it a local picture? Then make it smaller here
                        $preview = str_replace(["-0.jpg", "-0.png"], ["-2.jpg", "-2.png"], $preview);
@@ -1258,7 +1258,7 @@ class OStatus
                XML::addElement($doc, $root, "id", DI::baseUrl() . "/profile/" . $owner["nick"]);
                XML::addElement($doc, $root, "title", $title);
                XML::addElement($doc, $root, "subtitle", sprintf("Updates from %s on %s", $owner["name"], DI::config()->get('config', 'sitename')));
-               XML::addElement($doc, $root, "logo", User::getAvatarUrl($owner, ProxyUtils::SIZE_SMALL));
+               XML::addElement($doc, $root, "logo", User::getAvatarUrl($owner, Proxy::SIZE_SMALL));
                XML::addElement($doc, $root, "updated", DateTimeFormat::utcNow(DateTimeFormat::ATOM));
 
                $author = self::addAuthor($doc, $owner, true);
@@ -1413,18 +1413,18 @@ class OStatus
                $attributes = [
                                "rel" => "avatar",
                                "type" => "image/jpeg", // To-Do?
-                               "media:width" => ProxyUtils::PIXEL_SMALL,
-                               "media:height" => ProxyUtils::PIXEL_SMALL,
-                               "href" => User::getAvatarUrl($owner, ProxyUtils::SIZE_SMALL)];
+                               "media:width" => Proxy::PIXEL_SMALL,
+                               "media:height" => Proxy::PIXEL_SMALL,
+                               "href" => User::getAvatarUrl($owner, Proxy::SIZE_SMALL)];
                XML::addElement($doc, $author, "link", "", $attributes);
 
                if (isset($owner["thumb"])) {
                        $attributes = [
                                        "rel" => "avatar",
                                        "type" => "image/jpeg", // To-Do?
-                                       "media:width" => ProxyUtils::PIXEL_THUMB,
-                                       "media:height" => ProxyUtils::PIXEL_THUMB,
-                                       "href" => User::getAvatarUrl($owner, ProxyUtils::SIZE_THUMB)];
+                                       "media:width" => Proxy::PIXEL_THUMB,
+                                       "media:height" => Proxy::PIXEL_THUMB,
+                                       "href" => User::getAvatarUrl($owner, Proxy::SIZE_THUMB)];
                        XML::addElement($doc, $author, "link", "", $attributes);
                }
 
index 27480900008859cfb612e54ac8d7f62717285a5f..dcc46115588af775e53d1feb16861afa93b615e9 100644 (file)
@@ -75,7 +75,7 @@ class Proxy
         * provided URL isn't local
         *
         * @param string $url       The URL to proxyfy
-        * @param string $size      One of the ProxyUtils::SIZE_* constants
+        * @param string $size      One of the Proxy::SIZE_* constants
         *
         * @return string The proxyfied URL or relative path
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
index baf15387da5b4ece7092a9d2dbaf2f1acc3ae355..33bf5894752bcd74aa5a9681c4c41d1a8e710150 100644 (file)
@@ -23,8 +23,6 @@ namespace Friendica\Worker;
 
 use Friendica\Database\DBA;
 use Friendica\DI;
-use Friendica\Model\Photo;
-use Friendica\Util\Proxy as ProxyUtils;
 
 /**
  * Clear cache entries