diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2012-09-07 15:22:01 +0200 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2012-09-07 15:22:01 +0200 |
commit | 3829460ab8cbb6de65c53583a20fd04cbe7927dd (patch) | |
tree | 4dc24845a5eb31b17510a621e14c15b51f16bf7b /lib/eventsource.php | |
parent | 785aa751bb5f9a4bcdd677b96207550482e17d3c (diff) | |
download | nextcloud-server-3829460ab8cbb6de65c53583a20fd04cbe7927dd.tar.gz nextcloud-server-3829460ab8cbb6de65c53583a20fd04cbe7927dd.zip |
adding space between) and {
Diffstat (limited to 'lib/eventsource.php')
-rw-r--r-- | lib/eventsource.php | 16 |
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 |