$locate =
$this->registry->
create('Locator', array
(&
$file,
$this->timeout,
$this->useragent,
$this->max_checked_feeds,
$this->force_fsockopen,
$this->curl_options
));
if (!
$locate->
is_feed($file)) { $copyStatusCode =
$file->status_code;
$copyContentType =
$file->headers
['content-type'
];
try { $microformats = false;
if (class_exists('DOMXpath'
) &&
function_exists('Mf2\parse'
)) { $doc =
new DOMDocument();
@
$doc->
loadHTML($file->body
);
$xpath =
new DOMXpath($doc);
// Check for both h-feed and h-entry, as both a feed with no entries
// and a list of entries without an h-feed wrapper are both valid.
$query = '//*[contains(concat(" ", @class, " "), " h-feed ") or '.
'contains(concat(" ", @class, " "), " h-entry ")]';
$result =
$xpath->
query($query);
$microformats =
$result->length !== 0;
} // Now also do feed discovery, but if microformats were found don't
// overwrite the current value of file.
$discovered =
$locate->
find($this->autodiscovery,