Drupal 8  8.0.2
UpdateFetcher Class Reference
Inheritance diagram for UpdateFetcher:

Public Member Functions

 __construct (ConfigFactoryInterface $config_factory, ClientInterface $http_client)
 
 fetchProjectData (array $project, $site_key= '')
 
 buildFetchUrl (array $project, $site_key= '')
 
 getFetchBaseUrl ($project)
 

Data Fields

const UPDATE_DEFAULT_URL = 'http://updates.drupal.org/release-history'
 

Protected Attributes

 $fetchUrl
 
 $updateSettings
 
 $httpClient
 

Detailed Description

Fetches project information from remote locations.

Constructor & Destructor Documentation

__construct ( ConfigFactoryInterface  $config_factory,
ClientInterface  $http_client 
)

Constructs a UpdateFetcher.

Parameters
\Drupal\Core\Config\ConfigFactoryInterface$config_factoryThe config factory.
\GuzzleHttp\ClientInterface$http_clientA Guzzle client object.

References ConfigFactoryInterface\get(), and Drupal\httpClient().

Here is the call graph for this function:

Member Function Documentation

buildFetchUrl ( array  $project,
  $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.

Parameters
array$projectThe array of project information from ::getProjects().
string$site_key(optional) The anonymous site key hash. Defaults to an empty string.
Returns
string The URL for fetching information about updates to the specified project.
See Also
::fetchData()
::processFetchTask()
::getProjects()
}

Implements UpdateFetcherInterface.

References Drupal\CORE_COMPATIBILITY, and UpdateFetcher\getFetchBaseUrl().

Referenced by UpdateFetcher\fetchProjectData().

Here is the call graph for this function:

Here is the caller graph for this function:

fetchProjectData ( array  $project,
  $site_key = '' 
)

{Retrieves the project information.

Parameters
array$projectThe array of project information from ::getProjects().
string$site_key(optional) The anonymous site key hash. Defaults to an empty string.
Returns
string The project information fetched as string. Empty string upon failure.
}

Implements UpdateFetcherInterface.

References UpdateFetcher\buildFetchUrl(), and Drupal\httpClient().

Here is the call graph for this function:

getFetchBaseUrl (   $project)

{Returns the base of the URL to fetch available update data for a project.

Parameters
array$projectThe array of project information from ::getProjects().
Returns
string The base of the URL used for fetching available update data. This does not include the path elements to specify a particular project, version, site_key, etc.
}

Implements UpdateFetcherInterface.

Referenced by UpdateFetcher\buildFetchUrl().

Here is the caller graph for this function:

Field Documentation

const UPDATE_DEFAULT_URL = 'http://updates.drupal.org/release-history'

URL to check for updates, if a given project doesn't define its own.


The documentation for this class was generated from the following file: