diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2024-03-24 09:58:21 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-03-24 09:58:21 +0000 |
commit | 0dc959d9fe40bddce5e99b8162bb0e770fc28ed9 (patch) | |
tree | 4ad4413b0c00d1a478111b031d9de46218f31a89 /Zotlabs/Photo | |
parent | acc1834b0dc4804703610101fa95a3375649bc45 (diff) | |
download | volse-hubzilla-0dc959d9fe40bddce5e99b8162bb0e770fc28ed9.tar.gz volse-hubzilla-0dc959d9fe40bddce5e99b8162bb0e770fc28ed9.tar.bz2 volse-hubzilla-0dc959d9fe40bddce5e99b8162bb0e770fc28ed9.zip |
Deprecate *_config() functions in core.
Diffstat (limited to 'Zotlabs/Photo')
-rw-r--r-- | Zotlabs/Photo/PhotoDriver.php | 5 | ||||
-rw-r--r-- | Zotlabs/Photo/PhotoGd.php | 8 | ||||
-rw-r--r-- | Zotlabs/Photo/PhotoImagick.php | 8 |
3 files changed, 13 insertions, 8 deletions
diff --git a/Zotlabs/Photo/PhotoDriver.php b/Zotlabs/Photo/PhotoDriver.php index fc34f87a9..e8b42ec1b 100644 --- a/Zotlabs/Photo/PhotoDriver.php +++ b/Zotlabs/Photo/PhotoDriver.php @@ -2,6 +2,7 @@ namespace Zotlabs\Photo; +use Zotlabs\Lib\Config; use Zotlabs\Lib\Hashpath; /** @@ -443,7 +444,7 @@ abstract class PhotoDriver { $p['display_path'] = $arr['display_path'] ?? ''; $p['width'] = $arr['width'] ?? $this->getWidth(); $p['height'] = $arr['height'] ?? $this->getHeight(); - $p['expires'] = $arr['expires'] ?? gmdate('Y-m-d H:i:s', time() + get_config('system', 'photo_cache_time', 86400)); + $p['expires'] = $arr['expires'] ?? gmdate('Y-m-d H:i:s', time() + Config::Get('system', 'photo_cache_time', 86400)); $p['profile'] = $arr['profile'] ?? 0; if(! intval($p['imgscale'])) @@ -508,7 +509,7 @@ abstract class PhotoDriver { $arr['imgscale'] = $scale; - if(boolval(get_config('system','photo_storage_type', 1))) { + if(boolval(Config::Get('system','photo_storage_type', 1))) { $arr['os_storage'] = 1; diff --git a/Zotlabs/Photo/PhotoGd.php b/Zotlabs/Photo/PhotoGd.php index 6854be0ab..4a47f97ee 100644 --- a/Zotlabs/Photo/PhotoGd.php +++ b/Zotlabs/Photo/PhotoGd.php @@ -2,6 +2,8 @@ namespace Zotlabs\Photo; +use Zotlabs\Lib\Config; + /** * @brief GD photo driver. * @@ -157,14 +159,14 @@ class PhotoGd extends PhotoDriver { switch($this->getType()){ case 'image/png': - $quality = get_config('system', 'png_quality'); + $quality = Config::Get('system', 'png_quality'); if((! $quality) || ($quality > 9)) $quality = PNG_QUALITY; \imagepng($this->image, NULL, $quality); break; case 'image/webp': - $quality = get_config('system', 'webp_quality'); + $quality = Config::Get('system', 'webp_quality'); if((! $quality) || ($quality > 100)) $quality = WEBP_QUALITY; \imagewebp($this->image, NULL, $quality); @@ -174,7 +176,7 @@ class PhotoGd extends PhotoDriver { // gd can lack imagejpeg(), but we verify during installation it is available default: - $quality = get_config('system', 'jpeg_quality'); + $quality = Config::Get('system', 'jpeg_quality'); if((! $quality) || ($quality > 100)) $quality = JPEG_QUALITY; \imagejpeg($this->image, NULL, $quality); diff --git a/Zotlabs/Photo/PhotoImagick.php b/Zotlabs/Photo/PhotoImagick.php index 0a08d19e6..59f276480 100644 --- a/Zotlabs/Photo/PhotoImagick.php +++ b/Zotlabs/Photo/PhotoImagick.php @@ -2,6 +2,8 @@ namespace Zotlabs\Photo; +use Zotlabs\Lib\Config; + /** * @brief ImageMagick photo driver. */ @@ -57,7 +59,7 @@ class PhotoImagick extends PhotoDriver { switch($this->getType()) { case 'image/png': - $quality = get_config('system', 'png_quality'); + $quality = Config::Get('system', 'png_quality'); if((! $quality) || ($quality > 9)) $quality = PNG_QUALITY; /* @@ -73,14 +75,14 @@ class PhotoImagick extends PhotoDriver { break; case 'image/jpeg': - $quality = get_config('system', 'jpeg_quality'); + $quality = Config::Get('system', 'jpeg_quality'); if((! $quality) || ($quality > 100)) $quality = JPEG_QUALITY; $this->image->setCompressionQuality($quality); break; case 'image/webp': - $quality = get_config('system', 'webp_quality'); + $quality = Config::Get('system', 'webp_quality'); if((! $quality) || ($quality > 100)) $quality = WEBP_QUALITY; $this->image->setCompressionQuality($quality); |