diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-05-16 17:25:13 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-05-16 17:28:54 +0200 |
commit | a9f71315757a4c48f84cf5928022fa2fa105fad9 (patch) | |
tree | b498f8535a0062eb1d6bbc7b9b1fa1bf6acec68f /lib | |
parent | 0e4aa4704404da056d5cd095a95f9bf57844c646 (diff) | |
download | nextcloud-server-a9f71315757a4c48f84cf5928022fa2fa105fad9.tar.gz nextcloud-server-a9f71315757a4c48f84cf5928022fa2fa105fad9.zip |
fix: Move OC_EventSource to OC namespace
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/composer/composer/autoload_classmap.php | 2 | ||||
-rw-r--r-- | lib/composer/composer/autoload_static.php | 2 | ||||
-rw-r--r-- | lib/private/EventSource.php (renamed from lib/private/legacy/OC_EventSource.php) | 12 | ||||
-rw-r--r-- | lib/private/EventSourceFactory.php | 16 |
4 files changed, 14 insertions, 18 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index cb57d44ea60..8e1408e121e 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -1382,6 +1382,7 @@ return array( 'OC\\Encryption\\Util' => $baseDir . '/lib/private/Encryption/Util.php', 'OC\\EventDispatcher\\EventDispatcher' => $baseDir . '/lib/private/EventDispatcher/EventDispatcher.php', 'OC\\EventDispatcher\\ServiceEventListener' => $baseDir . '/lib/private/EventDispatcher/ServiceEventListener.php', + 'OC\\EventSource' => $baseDir . '/lib/private/EventSource.php', 'OC\\EventSourceFactory' => $baseDir . '/lib/private/EventSourceFactory.php', 'OC\\Federation\\CloudFederationFactory' => $baseDir . '/lib/private/Federation/CloudFederationFactory.php', 'OC\\Federation\\CloudFederationNotification' => $baseDir . '/lib/private/Federation/CloudFederationNotification.php', @@ -1905,7 +1906,6 @@ return array( 'OC_API' => $baseDir . '/lib/private/legacy/OC_API.php', 'OC_App' => $baseDir . '/lib/private/legacy/OC_App.php', 'OC_Defaults' => $baseDir . '/lib/private/legacy/OC_Defaults.php', - 'OC_EventSource' => $baseDir . '/lib/private/legacy/OC_EventSource.php', 'OC_FileChunking' => $baseDir . '/lib/private/legacy/OC_FileChunking.php', 'OC_Files' => $baseDir . '/lib/private/legacy/OC_Files.php', 'OC_Helper' => $baseDir . '/lib/private/legacy/OC_Helper.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 0a4e9571049..d6939ae36ce 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -1423,6 +1423,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OC\\Encryption\\Util' => __DIR__ . '/../../..' . '/lib/private/Encryption/Util.php', 'OC\\EventDispatcher\\EventDispatcher' => __DIR__ . '/../../..' . '/lib/private/EventDispatcher/EventDispatcher.php', 'OC\\EventDispatcher\\ServiceEventListener' => __DIR__ . '/../../..' . '/lib/private/EventDispatcher/ServiceEventListener.php', + 'OC\\EventSource' => __DIR__ . '/../../..' . '/lib/private/EventSource.php', 'OC\\EventSourceFactory' => __DIR__ . '/../../..' . '/lib/private/EventSourceFactory.php', 'OC\\Federation\\CloudFederationFactory' => __DIR__ . '/../../..' . '/lib/private/Federation/CloudFederationFactory.php', 'OC\\Federation\\CloudFederationNotification' => __DIR__ . '/../../..' . '/lib/private/Federation/CloudFederationNotification.php', @@ -1946,7 +1947,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OC_API' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_API.php', 'OC_App' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_App.php', 'OC_Defaults' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_Defaults.php', - 'OC_EventSource' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_EventSource.php', 'OC_FileChunking' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_FileChunking.php', 'OC_Files' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_Files.php', 'OC_Helper' => __DIR__ . '/../../..' . '/lib/private/legacy/OC_Helper.php', diff --git a/lib/private/legacy/OC_EventSource.php b/lib/private/EventSource.php index 49fde4a214f..9a62d13a938 100644 --- a/lib/private/legacy/OC_EventSource.php +++ b/lib/private/EventSource.php @@ -1,7 +1,5 @@ <?php -use OCP\IRequest; - /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -29,7 +27,13 @@ use OCP\IRequest; * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -class OC_EventSource implements \OCP\IEventSource { + +namespace OC; + +use OCP\IEventSource; +use OCP\IRequest; + +class EventSource implements IEventSource { /** * @var bool */ @@ -58,7 +62,7 @@ class OC_EventSource implements \OCP\IEventSource { $this->started = true; // prevent php output buffering, caching and nginx buffering - OC_Util::obEnd(); + \OC_Util::obEnd(); header('Cache-Control: no-cache'); header('X-Accel-Buffering: no'); $this->fallback = isset($_GET['fallback']) and $_GET['fallback'] == 'true'; diff --git a/lib/private/EventSourceFactory.php b/lib/private/EventSourceFactory.php index 197c8bf9e6c..2fff93f7176 100644 --- a/lib/private/EventSourceFactory.php +++ b/lib/private/EventSourceFactory.php @@ -27,20 +27,12 @@ use OCP\IEventSourceFactory; use OCP\IRequest; class EventSourceFactory implements IEventSourceFactory { - private IRequest $request; - - - public function __construct(IRequest $request) { - $this->request = $request; + public function __construct( + private IRequest $request, + ) { } - /** - * Create a new event source - * - * @return IEventSource - * @since 28.0.0 - */ public function create(): IEventSource { - return new \OC_EventSource($this->request); + return new EventSource($this->request); } } |