function __construct() { global $wgExtensionFunctions; // Extension setup hook $wgExtensionFunctions[] = 'WebSocket::setup'; // Give this client an ID or use that supplied in request self::$clientID = array_key_exists('clientID', $_REQUEST) ? $_REQUEST['clientID'] : uniqid('WS'); // Is this an SSL connection? self::$ssl = array_key_exists('HTTPS', $_SERVER) && $_SERVER['HTTPS']; }