wp-includes/SimplePie/src/Locator.php:26Used for feed auto-discovery
$useragentSimplePie\?stringpublic$timeoutintpublic$fileSimplePie\Filepublic$localstring[]public$elsewherestring[]public$cached_entitiesSimplePie\array<mixed>public$http_basestringpublic$basestringpublic$base_locationintpublic$checked_feedsintpublic$max_checked_feedsintpublic$force_fsockopenboolpublic$curl_optionsSimplePie\array<int,public$domSimplePie\?\DomDocumentpublic$registrySimplePie\?Registryprotected$http_clientSimplePie\HTTP\Client|nullprivateclass Locator implements RegistryAware{ /** @var ?string */ public $useragent = null; /** @var int */ public $timeout = 10; /** @var File */ public $file; /** @var string[] */ public $local = []; /** @var string[] */ public $elsewhere = []; /** @var array<mixed> */ public $cached_entities = []; /** @var string */ public $http_base; /** @var string */ public $base; /** @var int */ public $base_location = 0; /** @var int */ public $checked_feeds = 0; /** @var int */ public $max_checked_feeds = 10; /** @var bool */ public $force_fsockopen = false; /** @var array<int, mixed> */ public $curl_options = []; /** @var ?\DomDocument */ public $dom; /** @var ?Registry */ protected $registry; /** * @var Client|null */ private $http_client = null; /** * @param array<int, mixed> $curl_options */ public function __construct(File $file, int $timeout = 10, ?string $useragent = null, int $max_checked_feeds = 10, bool $force_fsockopen = false, array $curl_options = []) { $this->file = $file; $this->useragent = $useragent; $this->timeout = $timeout; $this->max_checked_feeds = $max_checked_feeds; $this->force_fsockopen = $force_fsockopen; $this->curl_options = $curl_options; $body = $this->file->get_body_content(); if (class_exists('DOMDocument') && $body != '') { $this->dom = new \DOMDocument(); set_error_handler([Misc::class, 'silence_errors']); try { $this->dom->loadHTML($body); } catch (\Throwable $ex) { $this->dom = null; } restore_error_handler(); } else { $this->dom = null; } } /** * Set a PSR-18 client and PSR-17 factories * * Allows you to use your own HTTP client implementations. */ final public function set_http_client( ClientInterface $http_client, RequestFactoryInterface $request_factory, UriFactoryInterface $uri_factory ): void { $this->http_client = new Psr18Client($http_client, $request_factory, $uri_factory); }2 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
set_http_client() added.verified against sourceget_http_client() added.verified against sourcesrc/wp-includes/SimplePie/src/Locator.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.