public static function isAvailable() { $wrappers = stream_get_wrappers(); return in_array('http', $wrappers) && in_array('https', $wrappers); }
public static function getProvider() { if (Curl::isAvailable()) { return new Curl(); } if (Stream::isAvailable()) { return new Stream(); } throw new ProviderException("There isn't any available provider"); }