Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/eventsource.php')
-rw-r--r--lib/eventsource.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/eventsource.php b/lib/eventsource.php
index 45a20806b6e..900b5b101e6 100644
--- a/lib/eventsource.php
+++ b/lib/eventsource.php
@@ -31,18 +31,18 @@ class OC_EventSource{
private $fallback;
private $fallBackId=0;
- public function __construct(){
+ public function __construct() {
@ob_end_clean();
header('Cache-Control: no-cache');
$this->fallback=isset($_GET['fallback']) and $_GET['fallback']=='true';
- if($this->fallback){
+ if($this->fallback) {
$this->fallBackId=$_GET['fallback_id'];
header("Content-Type: text/html");
echo str_repeat('<span></span>'.PHP_EOL,10); //dummy data to keep IE happy
}else{
header("Content-Type: text/event-stream");
}
- if( !OC_Util::isCallRegistered()){
+ if( !OC_Util::isCallRegistered()) {
exit();
}
flush();
@@ -56,16 +56,16 @@ class OC_EventSource{
*
* if only one paramater is given, a typeless message will be send with that paramater as data
*/
- public function send($type,$data=null){
- if(is_null($data)){
+ public function send($type,$data=null) {
+ if(is_null($data)) {
$data=$type;
$type=null;
}
- if($this->fallback){
+ if($this->fallback) {
$response='<script type="text/javascript">window.parent.OC.EventSource.fallBackCallBack('.$this->fallBackId.',"'.$type.'",'.json_encode($data).')</script>'.PHP_EOL;
echo $response;
}else{
- if($type){
+ if($type) {
echo 'event: '.$type.PHP_EOL;
}
echo 'data: '.json_encode($data).PHP_EOL;
@@ -77,7 +77,7 @@ class OC_EventSource{
/**
* close the connection of the even source
*/
- public function close(){
+ public function close() {
$this->send('__internal__','close');//server side closing can be an issue, let the client do it
}
} \ No newline at end of file