예제 #1
0
파일: Session.php 프로젝트: Nyco/movim
 private function register($loop, $me)
 {
     $buffer = '';
     // Launching the linker
     $this->process = new \React\ChildProcess\Process('exec php linker.php', null, array('sid' => $this->sid, 'baseuri' => $this->baseuri));
     $this->process->start($loop);
     // Buffering the incoming data and fire it once its complete
     $this->process->stdout->on('data', function ($output) use($me, &$buffer) {
         if (substr($output, -1) == "") {
             $out = $buffer . substr($output, 0, -1);
             $buffer = '';
             $me->messageOut($out);
         } else {
             $buffer .= $output;
         }
     });
     // The linker died, we close properly the session
     $this->process->on('exit', function ($output) use($me) {
         echo colorize($this->sid, 'yellow') . " : " . colorize("linker killed \n", 'red');
         $me->process = null;
         $me->closeAll();
         $sd = new \Modl\SessionxDAO();
         $sd->delete($this->sid);
     });
     // Debug only, if the linker output some errors
     $this->process->stderr->on('data', function ($output) use($me) {
         echo $output;
     });
 }
예제 #2
0
파일: Sessionx.php 프로젝트: Anon215/movim
 public function destroy()
 {
     $sd = new \Modl\SessionxDAO();
     $sd->delete(self::$_sessionid);
 }
예제 #3
0
파일: Core.php 프로젝트: Nyco/movim
 private function closeEmptySession($sid)
 {
     // No WebSockets and no linker ? We close the whole session
     if ($this->sessions[$sid]->countClients() == 0 && $this->sessions[$sid]->process == null) {
         $sd = new \Modl\SessionxDAO();
         $sd->delete($sid);
         unset($this->sessions[$sid]);
     }
 }