constants = $constants['sockets']; } else { trigger_error('Sockets extension is not enabled', E_USER_WARNING); $this->constants = array(); } } /** * @param string $name * @return int */ public function __get($name) { return isset($this->constants[$name]) ? $this->constants[$name] : 0; } /** * @param string $name * @param int $value * @internal */ public function __set($name, $value) { } /** * @param string $name * @return bool */ public function __isset($name) { return isset($this->constants[$name]); } /** * @return self */ public static function getInstance() { if (!self::$instance) { self::$instance = new self(); } return self::$instance; } }