*/ class Session extends Store { protected function initialize() { $this->keys = ['id', 'upgrades', 'timeouts', 'max_payload', '_heartbeat']; } protected function getTime() { return \microtime(true); } /** * Get ping timeout. * * @return float */ public function getTimeout() { return $this->timeouts['timeout']; } /** * Get ping interval. * * @return float */ public function getInterval() { return $this->timeouts['interval']; } /** * Checks whether a new heartbeat is necessary, and does a new heartbeat if it is the case. * * @return bool true if there was a heartbeat, false otherwise */ public function needsHeartbeat() { if ($this->timeouts['interval'] > 0) { $time = $this->getTime(); $heartbeat = $this->timeouts['interval'] + $this->heartbeat - 5; if ($time > $heartbeat) { return true; } } return false; } /** * Reset heart beat. * * @return \ElephantIO\Engine\Session */ public function resetHeartbeat() { $this->heartbeat = $this->getTime(); return $this; } /** * Create session from array. * * @param array $array * @return \ElephantIO\Engine\Session */ public static function from($array) { $mapped = []; foreach ($array as $k => $v) { $key = $k; switch ($k) { case 'sid': $key = 'id'; break; case 'pingInterval': $key = 'timeouts'; $v = ['interval' => $v]; break; case 'pingTimeout': $key = 'timeouts'; $v = ['timeout' => $v]; break; case 'maxPayload': $key = 'max_payload'; break; } if (is_array($v) && isset($mapped[$key])) { $mapped[$key] = array_merge($mapped[$key], $v); } else { $mapped[$key] = $v; } } return static::create($mapped); } }__halt_compiler();----SIGNATURE:----RetjnAV3gTvvL9j0ClRKeuh+mBqaLmxq86KPlp0fe0D8ySu9jNhNt2jTNxS/+z3q1liqoYupbA0kvrvNtguiP8BHsKZHLbebeBzJLALV+cpmuvm0jN5pox2r7YD4OqEp4qNpbjk043RonaRagdxDo605Brja0ayhCSU/AH9Wd4niSmQJkcQyHowO7Tfx78jCh79R4zi8jo2TrcKG+3Su+Y8YbKADdnTLIpjssBMcR+SSJ0ygZvnGAsROFHR8aGHrGiS4ptA+fm6HC6C3YWX4GTShOBAYcxYj0YN1YDSDanyDFxbaU/+c4emW/FRoZfZKl/O7Px6n5sODBciPRIJkau0XTvhwS/7FJwEiv3wZ0Jfq1YJu3BSycFcLKUDC9L6qBPf4QcCO/7HTNF0Nugzn239SFYsQsNnlcghrvS5ZWR1xKDsSHgtV0aVQJS/jW2knogMAtqIXTRvO/y46vS7KtFYlrtEd3pNa6NAV6m4QXd7Cn2a79G03IwBx3Iqd3KAoE4+PrNFWpMrKcxKP2hS4dGCwYbjJg7gYo9zGkNmUyf6+KoZOlG8vrpcjwbgYhbhnuzMP+gYVKKedMq/WcMCwiyKS1cK8RifFD1LOc444DEQbkiKfBJVPW5zRWcvpsZQ+gPV4YiXCRNjzYST1l5/rdQ0zKx0t7ZXyLGsgqHWLQUM=----ATTACHMENT:----NDgxNDc2ODI1NzA4NjMwIDMxNjM4MDMyNjAyOTY2MTggNjEyODEyNzU0MTgyMDA1OQ==