Horde_Data_Base::importUrl PHP Method

importUrl() public method

Imports a URL.
Since: 2.1.0
public importUrl ( $url, $header = false )
    public function importUrl($url, $header = false)
    {
        if (!isset($this->_http)) {
            throw new LogicException('Missing http parameter.');
        }
        try {
            $response = $this->_http->get($url);
            if ($response->code != 200) {
                throw new Horde_Data_Exception(sprintf(Horde_Data_Translation::t("URL %s not found"), $url));
            }
            $data = $response->getBody();
        } catch (Horde_Http_Exception $e) {
            throw new Horde_Data_Exception($e);
        }
        return $this->importData($data, $header);
    }