protected function registerHTTPServerInterface(INabuHTTPServerInterface $interface) : bool
    {
        $hash = $interface->getHash();
        if (is_array($this->http_server_interface_list) && array_key_exists($hash, $this->http_server_interface_list)) {
            throw new ENabuHTTPException(
                ENabuHTTPException::ERROR_HTTP_SERVER_INSTANCE_ALREADY_REGISTERED,
                array(get_class($interface))
            );
        }

        if ($this->http_server_interface_list === null) {
            $this->http_server_interface_list = array($hash => $interface);
        } else {
            $this->http_server_interface_list[$hash] = $interface;
        }

        return $interface->init();
    }
protected function registerHTTPServerInterface(INabuHTTPServerInterface $interface) : bool
    {
        $hash = $interface->getHash();
        if (is_array($this->http_server_interface_list) && array_key_exists($hash, $this->http_server_interface_list)) {
            throw new ENabuHTTPException(
                ENabuHTTPException::ERROR_HTTP_SERVER_INSTANCE_ALREADY_REGISTERED,
                array(get_class($interface))
            );
        }

        if ($this->http_server_interface_list === null) {
            $this->http_server_interface_list = array($hash => $interface);
        } else {
            $this->http_server_interface_list[$hash] = $interface;
        }

        return $interface->init();
    }
protected function registerHTTPServerInterface ( INabuHTTPServerInterface $ interface ) : bool { $ hash = $ interface -> getHash ( ) ; if ( is_array ( $ this -> http_server_interface_list ) && array_key_exists ( $ hash , $ this -> http_server_interface_list ) ) { throw new ENabuHTTPException ( ENabuHTTPException :: ERROR_HTTP_SERVER_INSTANCE_ALREADY_REGISTERED , array ( get_class ( $ interface ) ) ) ; } if ( $ this -> http_server_interface_list === null ) { $ this -> http_server_interface_list = array ( $ hash => $ interface ) ; } else { $ this -> http_server_interface_list [ $ hash ] = $ interface ; } return $ interface -> init ( ) ; }
Register a new HTTP Server Interface instance.
@param INabuHTTPServerInterface $interface Interface instance to be registered.
@return bool Returns true if the instance is registered and initiated.
@throws ENabuHTTPException Raises an exception if $interface is already registered.
Register a new HTTP Server Interface instance .