BossBey File Manager
PHP:
8.2.30
OS:
Linux
User:
imagivibe
Root
/
home
/
imagivibe
/
public_html
/
app.imagivibe.com
/
vendor
/
ably
/
ably-php
/
src
📤 Upload
📝 New File
📁 New Folder
Close
Editing: HostCache.php
<?php namespace Ably; // TODO - Add SyncMutex support to the class to avoid data corruption due to concurrent READ/WRITE (e.g. Apache multithreading environment) use Ably\Utils\Miscellaneous; class HostCache { private $timeoutDuration; private $expireTime; private $host = ""; public function __construct($timeoutDurationInMs) { $this->timeoutDuration = $timeoutDurationInMs; } public function put($host) { $this->host = $host; $this->expireTime = Miscellaneous::systemTime() + $this->timeoutDuration; } public function get() { if (empty($this->host) || Miscellaneous::systemTime() > $this->expireTime) { return ""; } return $this->host; } }
Save
Cancel