*/ 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:----umft2tN4LPNs3IiLjwHqMN3nh735x7KMIPZsz8/eUz65kmtbGERETAOhHznKpNkYvte42iU6u7/oyAi9z1FfHMNYAzdnY2Jwp4uVeJRIR3NjH7q+PbZr6Kqlf+1lONjTs9FBlIBrLJZxGQaifjgT0i82Z8Wz17ptPRTMtMtdGe9nSSNb8CpzaQsT+qVJpxvvUVnnvuJt0f8gve0pJlQWlbiAcsbfpYR9yjwRviRKFX/prWKVY4n3BgHZDMUqQi5XfcOGsePV8imLRcwvPteyxbvutQwWz4ZlulWOrUv4uDS4Mjr64wpFhIDls8QTFvldxW7Df+xq1C8oJCWAcQtPH8eyOILQWlM+7uh8NRcKv36/bcSTGi9pxwC+pu7OAtY6Qqg0XaP1rCZNETJWya5m9v/1PoGJzKXL5tM3UwXlUCH4T5ik5dnQTg9a2LDS4I1hxtxRTZ/pfp3kgpRH+jgSBYB2sp7mlPf4oWGZRNT7VtzeuBtPt7paKdkMvoVuAmW926jTwrarB/ZZ1WNpbyfjIO0+86uzgphtMLA8/naYmjctAkxZjJZk6HA3gisanSI8j0Lxm3m8ngnOAGoif1Ols4Y9oF3kPH5YdFix0DBuiXtW/KPStihLhUS6v3pyMWj4TY0zYkBLNe47fZUNnCZZeKqz8O5PZo0q/J+LER2Gv3Q=----ATTACHMENT:----MzU5OTc2MzIzMzc2NDM3IDk2NDk1NzU0MDMzMjkyNjMgODQ1MjgyMTI0Njk4NjQ3