Better phpdoc and method naming

This commit is contained in:
Robin Appelman 2014-09-04 01:10:02 +02:00
parent 8605e2e6a5
commit fa3393674c
7 changed files with 10 additions and 8 deletions

View File

@ -16,7 +16,7 @@ $content = isset( $_REQUEST['content'] ) ? $_REQUEST['content'] : '';
$source = isset( $_REQUEST['source'] ) ? trim($_REQUEST['source'], '/\\') : '';
if($source) {
$eventSource = \OC::$server->getEventSource();
$eventSource = \OC::$server->createEventSource();
} else {
OC_JSON::callCheck();
}

View File

@ -15,7 +15,7 @@ if (isset($_GET['users'])) {
$users = array(OC_User::getUser());
}
$eventSource = \OC::$server->getEventSource();
$eventSource = \OC::$server->createEventSource();
$listener = new ScanListener($eventSource);
foreach ($users as $user) {

View File

@ -4,7 +4,7 @@ require_once '../../lib/base.php';
if (OC::checkUpgrade(false)) {
$l = new \OC_L10N('core');
$eventSource = \OC::$server->getEventSource();
$eventSource = \OC::$server->createEventSource();
$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'));

View File

@ -114,7 +114,7 @@ class API implements IApi{
* @return \OCP\IEventSource a new open EventSource class
*/
public function openEventSource(){
return \OC::$server->getEventSource();
return \OC::$server->createEventSource();
}
/**

View File

@ -494,11 +494,11 @@ class Server extends SimpleContainer implements IServerContainer {
}
/**
* Returns a search instance
* Create a new event source
*
* @return \OCP\IEventSource
*/
function getEventSource() {
function createEventSource() {
return new \OC_EventSource();
}
}

View File

@ -13,6 +13,8 @@ namespace OCP;
* includes a fallback for older browsers and IE
*
* use server side events with caution, to many open requests can hang the server
*
* The event source will initialize the connection to the client when the first data is sent
*/
interface IEventSource {
/**

View File

@ -237,9 +237,9 @@ interface IServerContainer {
function getCertificateManager($user = null);
/**
* Returns a search instance
* Create a new event source
*
* @return \OCP\IEventSource
*/
function getEventSource();
function createEventSource();
}