Curious why you're doing this check here.  `JHttp` can function even if `allow_url_fopen` is disabled.  You should be able to do completely without this check; `JHttpTransportStream` which does require it is smart enough to check this dependency before trying to use that adapter.