load($str);
}
/**
* Creates a new dom object and calls loadFromFile() on the
* new object.
*
* @param string $file
* @return $this
*/
public static function loadFromFile($file)
{
$dom = new Dom;
self::$dom = $dom;
return $dom->loadFromFile($file);
}
/**
* Creates a new dom object and calls loadFromUrl() on the
* new object.
*
* @param string $url
* @param array $options
* @param CurlInterface $curl
* @return $this
*/
public static function loadFromUrl($url, $options = array(), CurlInterface $curl = null)
{
$dom = new Dom;
self::$dom = $dom;
if (is_null($curl)) {
// use the default curl interface
$curl = new Curl;
}
return $dom->loadFromUrl($url, $options, $curl);
}
/**
* Sets the $dom variable to null.
*/
public static function unload()
{
self::$dom = null;
}
}