NukeViet\Http\Http::_get_first_available_transport PHP Method

_get_first_available_transport() public method

public _get_first_available_transport ( mixed $args, mixed $url = null )
$args mixed
$url mixed
    public function _get_first_available_transport($args, $url = null)
    {
        $request_order = array('Curl', 'Streams');
        // Loop over each transport on each HTTP request looking for one which will serve this request's needs
        foreach ($request_order as $transport) {
            $class = 'NukeViet\\Http\\' . $transport;
            // Check to see if this transport is a possibility, calls the transport statically
            if (!call_user_func(array($class, 'test'), $args, $url)) {
                continue;
            }
            return $class;
        }
        return false;
    }