Remove all the {{{ and }}} folding
This commit is contained in:
18
src/Sse.php
18
src/Sse.php
@@ -22,7 +22,6 @@ class Sse
|
||||
//////////////////////////
|
||||
//// PROPERTIES ////
|
||||
//////////////////////////
|
||||
// {{{
|
||||
/** The backend File to use
|
||||
*/
|
||||
private $files;
|
||||
@@ -41,7 +40,6 @@ class Sse
|
||||
/** The handlers parameters
|
||||
*/
|
||||
private $handlersParams = array ();
|
||||
// }}}
|
||||
|
||||
//////////////////////////////
|
||||
//// SETTER METHODS ////
|
||||
@@ -54,7 +52,6 @@ class Sse
|
||||
* @return $this
|
||||
*/
|
||||
final public function setBackendFiles ($files)
|
||||
// {{{
|
||||
{
|
||||
if (! is_array ($files))
|
||||
$files = array ("data" => $files);
|
||||
@@ -76,14 +73,12 @@ class Sse
|
||||
$this->files = $files;
|
||||
return $this;
|
||||
}
|
||||
// }}}
|
||||
|
||||
/** The pingTime to use. Must be positive. If null, the ping is disabled
|
||||
* @param integer|float $pingTime The time in seconds between two keepalive
|
||||
* pings
|
||||
*/
|
||||
final public function setPingTime ($pingTime)
|
||||
// {{{
|
||||
{
|
||||
if (! is_float ($pingTime) && ! is_integer ($pingTime))
|
||||
throw new \Exception (sprintf (dgettext ("domframework",
|
||||
@@ -96,7 +91,6 @@ class Sse
|
||||
$this->pingTime = $pingTime;
|
||||
return $this;
|
||||
}
|
||||
// }}}
|
||||
|
||||
/** The optional handler to use in DataOnly. Must be callable method
|
||||
* @param callable|null $handler The handler
|
||||
@@ -104,7 +98,6 @@ class Sse
|
||||
* @param mixed... $params The optional needed parameters
|
||||
*/
|
||||
final public function setHandlerDataonly ($handler, $params = null)
|
||||
// {{{
|
||||
{
|
||||
if (! is_callable ($handler) && $handler !== null)
|
||||
throw new \Exception (dgettext ("domframework",
|
||||
@@ -115,7 +108,6 @@ class Sse
|
||||
$this->handlersParams["data"] = $args;
|
||||
return $this;
|
||||
}
|
||||
// }}}
|
||||
|
||||
/** The optional handler to use in Events. Must be array of callable methods
|
||||
* @param array $handlers The handlers method, array[event=>callable]
|
||||
@@ -127,7 +119,6 @@ class Sse
|
||||
* if event=>null is set, remove the parameters for the event
|
||||
*/
|
||||
final public function setHandlersEvent ($handlers, $params = null)
|
||||
// {{{
|
||||
{
|
||||
if (! is_array ($handlers))
|
||||
throw new \Exception (dgettext ("domframework",
|
||||
@@ -163,7 +154,6 @@ class Sse
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
// }}}
|
||||
|
||||
//////////////////////////////
|
||||
//// PUBLIC METHODS ////
|
||||
@@ -174,7 +164,6 @@ class Sse
|
||||
* Never return !
|
||||
*/
|
||||
final public function loop ()
|
||||
// {{{
|
||||
{
|
||||
if ($this->files === null)
|
||||
throw new \Exception (dgettext ("domframework",
|
||||
@@ -242,7 +231,6 @@ class Sse
|
||||
usleep(100000);
|
||||
}
|
||||
}
|
||||
// }}}
|
||||
|
||||
///////////////////////////////
|
||||
//// PRIVATE METHODS ////
|
||||
@@ -250,7 +238,6 @@ class Sse
|
||||
/** Initialize the backend : open all the files and go at the end
|
||||
*/
|
||||
private function backendInit ()
|
||||
// {{{
|
||||
{
|
||||
if ($this->files === null)
|
||||
throw new \Exception (dgettext ("domframework",
|
||||
@@ -265,7 +252,6 @@ class Sse
|
||||
}
|
||||
}
|
||||
}
|
||||
// }}}
|
||||
|
||||
/** Get the pending lines from requested backend
|
||||
* @param string $event The event to get data
|
||||
@@ -273,7 +259,6 @@ class Sse
|
||||
* @return string the data lines stored in the lines
|
||||
*/
|
||||
private function backendGet ($event)
|
||||
// {{{
|
||||
{
|
||||
// If the file was previously opened but doesn't exists anymore. Close it
|
||||
// and reopen it just after
|
||||
@@ -304,7 +289,6 @@ class Sse
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
// }}}
|
||||
|
||||
/** Initialize the backend for one specific file.
|
||||
* @param string $event The event to start
|
||||
@@ -312,7 +296,6 @@ class Sse
|
||||
* @return boolean false if the file doesn't exists
|
||||
*/
|
||||
private function backendInitEvent ($event, $filePath)
|
||||
// {{{
|
||||
{
|
||||
clearstatcache (true, $filePath);
|
||||
if (! file_exists (dirname ($filePath)))
|
||||
@@ -337,5 +320,4 @@ class Sse
|
||||
$this->fps[$event] = $fp;
|
||||
return $this;
|
||||
}
|
||||
// }}}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user