diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-08-29 17:21:52 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-09-03 13:36:15 +0200 |
commit | 65608d7c9253d03ba5b56615f850f19f1fd90a49 (patch) | |
tree | c40d78e7f4ea21ebe90e2a7590a57126fe310998 | |
parent | dad53180bc6c554336c3a30abf64e45c242b2262 (diff) | |
download | nextcloud-server-65608d7c9253d03ba5b56615f850f19f1fd90a49.tar.gz nextcloud-server-65608d7c9253d03ba5b56615f850f19f1fd90a49.zip |
Use the public api to get event sources
-rw-r--r-- | apps/files/ajax/newfile.php | 2 | ||||
-rw-r--r-- | apps/files/ajax/scan.php | 6 | ||||
-rw-r--r-- | core/ajax/update.php | 2 | ||||
-rw-r--r-- | lib/private/appframework/core/api.php | 7 |
4 files changed, 8 insertions, 9 deletions
diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php index 606576760ec..1070246fca9 100644 --- a/apps/files/ajax/newfile.php +++ b/apps/files/ajax/newfile.php @@ -16,7 +16,7 @@ $content = isset( $_REQUEST['content'] ) ? $_REQUEST['content'] : ''; $source = isset( $_REQUEST['source'] ) ? trim($_REQUEST['source'], '/\\') : ''; if($source) { - $eventSource=new OC_EventSource(); + $eventSource = \OC::$server->getEventSource(); } else { OC_JSON::callCheck(); } diff --git a/apps/files/ajax/scan.php b/apps/files/ajax/scan.php index 3ec7f9394b1..eed620113ac 100644 --- a/apps/files/ajax/scan.php +++ b/apps/files/ajax/scan.php @@ -15,7 +15,7 @@ if (isset($_GET['users'])) { $users = array(OC_User::getUser()); } -$eventSource = new OC_EventSource(); +$eventSource = \OC::$server->getEventSource(); $listener = new ScanListener($eventSource); foreach ($users as $user) { @@ -39,12 +39,12 @@ class ScanListener { private $lastCount = 0; /** - * @var \OC_EventSource event source to pass events to + * @var \OCP\IEventSource event source to pass events to */ private $eventSource; /** - * @param \OC_EventSource $eventSource + * @param \OCP\IEventSource $eventSource */ public function __construct($eventSource) { $this->eventSource = $eventSource; diff --git a/core/ajax/update.php b/core/ajax/update.php index 627ada080c8..89ce2798378 100644 --- a/core/ajax/update.php +++ b/core/ajax/update.php @@ -4,7 +4,7 @@ require_once '../../lib/base.php'; if (OC::checkUpgrade(false)) { $l = new \OC_L10N('core'); - $eventSource = new OC_EventSource(); + $eventSource = \OC::$server->getEventSource(); $updater = new \OC\Updater(\OC_Log::$object); $updater->listen('\OC\Updater', 'maintenanceStart', function () use ($eventSource, $l) { $eventSource->send('success', (string)$l->t('Turned on maintenance mode')); diff --git a/lib/private/appframework/core/api.php b/lib/private/appframework/core/api.php index ba6b9f95cb2..0dd3a583868 100644 --- a/lib/private/appframework/core/api.php +++ b/lib/private/appframework/core/api.php @@ -110,12 +110,11 @@ class API implements IApi{ /** - * used to return and open a new eventsource - * @return \OC_EventSource a new open EventSource class + * used to return and open a new event source + * @return \OCP\IEventSource a new open EventSource class */ public function openEventSource(){ - # TODO: use public api - return new \OC_EventSource(); + return \OC::$server->getEventSource(); } /** |