public function __construct($xml) { if (str::is_path($xml)) { if (str::is_url($xml)) { $r = remote::get($xml); $this->data = $r['content']; } else { $this->data = file_get_contents($xml); } } else { $this->data = $xml; } if (empty($this->data)) { return false; } unset($xml, $r, $fp); }
/** * Decides whether or not to return a site URL or the passed URL. * Very useful when you're passing URI's and URL's and need 1 function to do both. * * @param string site URL or URI * @param string non-default protocol * @return string */ public static function ify($uri = '', $protocol = NO) { if (str::is_url($uri)) { return $uri; } return url::site($uri, $protocol); }