$this->http=newHTTP('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 p3k/XRay');
$this->http=newHTTP('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 p3k/XRay');
if(is_array($options)){
$this->defaultOptions=$options;
}
}
}
publicfunctionrels($url,$opts=[]){
publicfunctionrels($url,$opts=[]){
$rels=newXRay\Rels($this->http);
$rels=newXRay\Rels($this->http);
// Merge provided options with default options, allowing provided options to override defaults.
$opts=array_merge($this->defaultOptions,$opts);
return$rels->parse($url,$opts);
return$rels->parse($url,$opts);
}
}
publicfunctionfeeds($url,$opts=[]){
publicfunctionfeeds($url,$opts=[]){
$feeds=newXRay\Feeds($this->http);
$feeds=newXRay\Feeds($this->http);
// Merge provided options with default options, allowing provided options to override defaults.
$opts=array_merge($this->defaultOptions,$opts);
return$feeds->find($url,$opts);
return$feeds->find($url,$opts);
}
}
@ -35,6 +44,9 @@ class XRay {
}
}
$parser=newXRay\Parser($this->http);
$parser=newXRay\Parser($this->http);
// Merge provided options with default options, allowing provided options to override defaults.
$opts=array_merge($this->defaultOptions,$opts);
$result=$parser->parse([
$result=$parser->parse([
'body'=>$body,
'body'=>$body,
'url'=>$url,
'url'=>$url,
@ -51,6 +63,8 @@ class XRay {
publicfunctionprocess($url,$mf2json,$opts=[]){
publicfunctionprocess($url,$mf2json,$opts=[]){
$parser=newXRay\Parser($this->http);
$parser=newXRay\Parser($this->http);
// Merge provided options with default options, allowing provided options to override defaults.