User tests: Successful: Unsuccessful:
We propose to add an alternative method to get the feed when the allow_url_open is OFF.
When the allow_url_open is OFF, the XMLReader::open always fails because the URL can not be connected.
So we propose to get the Feed with the alternative CURL when it is present.
I'd actually suggest using JHttp
instead of hard coding cURL in here as our JHttp
library supports cURL, socket, and stream connections. Otherwise, this is a good idea IMO.
$connector = JHttpFactory::getHttp();
try {
$feed = $connector->get($uri);
} catch (RuntimeException $e) {
// This is typically a failed connection
} catch (UnexpectedValueException $e) {
// The connector failed to correctly read the HTTP headers
}
I have updated the proposal to the the suggested JHttpFactory::getHttp();
You will see that I didn't put any Try/Catch as the function as to throw exception in case of errors.
So I have kept the JHttpFactory exceptions throw to the caller.
Added some notes about codestyle (http://joomla.github.io/coding-standards/)
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-06-09 01:55:37 |
Hi jms2win
thanks for your contribution.
here is your Tracker:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33163&start=0