]> git.mxchange.org Git - friendica.git/commitdiff
deprecate App::ge DI::app(),tTimeZone() and App::setTimezone()
authorArt4 <art4@wlabs.de>
Wed, 6 Nov 2024 07:52:46 +0000 (07:52 +0000)
committerArt4 <art4@wlabs.de>
Wed, 6 Nov 2024 07:52:46 +0000 (07:52 +0000)
src/App.php
src/DI.php

index 5bc9b68755b7bcb6423ae73f9004ef3611a1bfc6..25a57984ea9ea6c060e7d7ae9589aabd8fe20b4d 100644 (file)
@@ -172,23 +172,24 @@ class App
        /**
         * Set the timezone
         *
+        * @deprecated 2024.12 Use AppHelper::setTimeZone() instead
+        *
         * @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
         * @return void
         */
        public function setTimeZone(string $timezone)
        {
-               $this->timezone = (new \DateTimeZone($timezone))->getName();
-               DateTimeFormat::setLocalTimeZone($this->timezone);
+               DI::apphelper()->setTimeZone($timezone);
        }
 
        /**
         * Get the timezone
         *
-        * @return int
+        * @deprecated 2024.12 Use AppHelper::getTimeZone() instead
         */
        public function getTimeZone(): string
        {
-               return $this->timezone;
+               return DI::apphelper()->getTimeZone();
        }
 
        /**
@@ -364,7 +365,7 @@ class App
                        $timezone = $default_timezone ?? '' ?: 'UTC';
                }
 
-               $this->setTimeZone($timezone);
+               DI::apphelper()->setTimeZone($timezone);
        }
 
        /**
index 2c36c9c19001aa4c15de562e39e9b89e6edf469a..8f5c9859e5b09c02606350bd07afa8b12a7f9b85 100644 (file)
@@ -71,6 +71,8 @@ abstract class DI
        //
 
        /**
+        * @deprecated 2024.12 use DI::apphelper() instead
+        *
         * @return App
         */
        public static function app()