Skip to content

Commit

Permalink
docs(dev): remove deprecated createEventSource
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
  • Loading branch information
kesselb committed Jun 1, 2023
1 parent dda5c9b commit ab2f9c6
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Back-end changes
Added APIs
^^^^^^^^^^

* tbd
* ``\OCP\IEventSourceFactory``: To create a `OCP\IEventSource` instance.

Changed APIs
^^^^^^^^^^^^
Expand All @@ -66,3 +66,17 @@ Removed APIs
* ``\OC_App::getSettingsNavigation``: inject ``\OCP\App\IAppManager`` and call ``\OCP\App\IAppManager::getAll('settings')``.
* ``\OC_App::isEnabled``: inject ``\OCP\App\IAppManager`` and call ``\OCP\App\IAppManager::isEnabledForUser``.
* ``\OC_Defaults::getLogoClaim``: There is no replacement.
* `\OC::$server->createEventSource()` has been removed, use `\OC::$server->get(\OCP\IEventSourceFactory::class)->create()` instead.

The factory `\OCP\IEventSourceFactory` works only from Nextcloud 28. For older versions use \OC::$server->createEventSource().

If you want to support Nextcloud 27 and Nextcloud 28:

.. code-block:: php
// @TODO: Remove method_exists when min-version="28"
if (method_exists(\OC::$server, 'createEventSource')) {
$eventSource = \OC::$server->createEventSource();
} else {
$eventSource = \OCP\Server::get(IEventSourceFactory::class)->create();
}

0 comments on commit ab2f9c6

Please sign in to comment.