UpdateFetcher
class UpdateFetcher implements UpdateFetcherInterface (View source)
Fetches project information from remote locations.
Traits
Provides dependency injection friendly methods for serialization.
Constants
| UPDATE_DEFAULT_URL |
URL to check for updates, if a given project doesn't define its own. |
Properties
| protected array | $_serviceIds | An array of service IDs keyed by property name used for serialization. |
from DependencySerializationTrait |
| protected array | $_entityStorages | An array of entity type IDs keyed by the property name of their storages. |
from DependencySerializationTrait |
| protected string | $fetchUrl | The fetch url configured in the update settings. |
|
| protected Config | $updateSettings | The update settings. |
|
| protected ClientInterface | $httpClient | The HTTP client to fetch the feed data with. |
|
| protected bool | $withHttpFallback | Whether to use HTTP fallback if HTTPS fails. |
Methods
Constructs an UpdateFetcher.
Retrieves the project information.
Applies a GET request with a possible HTTP fallback.
Generates the URL to fetch information about project updates.
Returns the base of the URL to fetch available update data for a project.
Details
__sleep()
{@inheritdoc}
__wakeup()
{@inheritdoc}
__construct(ConfigFactoryInterface $config_factory, ClientInterface $http_client, Settings $settings = NULL)
Constructs an UpdateFetcher.
string
fetchProjectData(array $project, string $site_key = '')
Retrieves the project information.
protected string
doRequest(string $url, array $options, bool $with_http_fallback)
Applies a GET request with a possible HTTP fallback.
This method falls back to HTTP in case there was some certificate problem.
string
buildFetchUrl(array $project, string $site_key = '')
Generates the URL to fetch information about project updates.
This figures out the right URL to use, based on the project's .info.yml file and the global defaults. Appends optional query arguments when the site is configured to report usage stats.
string
getFetchBaseUrl(array $project)
Returns the base of the URL to fetch available update data for a project.