diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php index 768f848..1830d5b 100644 --- a/core/lib/Drupal.php +++ b/core/lib/Drupal.php @@ -403,15 +403,6 @@ public static function httpClient() { } /** - * Returns a factory for guzzle HTTP clients with Drupal options. - * - * @return \Drupal\Core\Http\ClientFactory - */ - public static function httpClientFactory() { - return static::getContainer()->get('http_client_factory'); - } - - /** * Returns the entity query object for this entity type. * * @param string $entity_type diff --git a/core/modules/locale/locale.batch.inc b/core/modules/locale/locale.batch.inc index befe914..c43508c 100644 --- a/core/modules/locale/locale.batch.inc +++ b/core/modules/locale/locale.batch.inc @@ -238,7 +238,7 @@ function locale_translation_http_check($uri) { $logger = \Drupal::logger('locale'); try { $actual_uri = NULL; - $response = \Drupal::httpClientFactory()->fromOptions(['allow_redirects' => [ + $response = \Drupal::service('http_client_factory')->fromOptions(['allow_redirects' => [ 'on_redirect' => function(RequestInterface $request, ResponseInterface $response, UriInterface $request_uri) use (&$actual_uri) { $actual_uri = (string) $request_uri; }]])->head($uri); diff --git a/core/modules/statistics/src/Tests/StatisticsAdminTest.php b/core/modules/statistics/src/Tests/StatisticsAdminTest.php index 9762d0a..7c4f583 100644 --- a/core/modules/statistics/src/Tests/StatisticsAdminTest.php +++ b/core/modules/statistics/src/Tests/StatisticsAdminTest.php @@ -54,7 +54,7 @@ protected function setUp() { $this->privilegedUser = $this->drupalCreateUser(array('administer statistics', 'view post access counter', 'create page content')); $this->drupalLogin($this->privilegedUser); $this->testNode = $this->drupalCreateNode(array('type' => 'page', 'uid' => $this->privilegedUser->id())); - $this->client = \Drupal::httpClientFactory() + $this->client = \Drupal::service('http_client_factory') ->fromOptions(['config/curl' => [CURLOPT_TIMEOUT => 10]]); } diff --git a/core/modules/statistics/src/Tests/StatisticsLoggingTest.php b/core/modules/statistics/src/Tests/StatisticsLoggingTest.php index c26ea04..1b83a25 100644 --- a/core/modules/statistics/src/Tests/StatisticsLoggingTest.php +++ b/core/modules/statistics/src/Tests/StatisticsLoggingTest.php @@ -61,7 +61,7 @@ protected function setUp() { // Clear the logs. db_truncate('node_counter'); - $this->client = \Drupal::httpClientFactory() + $this->client = \Drupal::service('http_client_factory') ->fromOptions(['config/curl' => [CURLOPT_TIMEOUT => 10]]); } diff --git a/core/modules/statistics/src/Tests/StatisticsReportsTest.php b/core/modules/statistics/src/Tests/StatisticsReportsTest.php index c35d091..f2a79ff 100644 --- a/core/modules/statistics/src/Tests/StatisticsReportsTest.php +++ b/core/modules/statistics/src/Tests/StatisticsReportsTest.php @@ -30,7 +30,7 @@ function testPopularContentBlock() { $headers = array('Content-Type' => 'application/x-www-form-urlencoded'); global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; - $client = \Drupal::httpClientFactory() + $client = \Drupal::service('http_client_factory') ->fromOptions(['config/curl' => [CURLOPT_TIMEOUT => 10]]); $client->post($stats_path, array('headers' => $headers, 'body' => $post)); diff --git a/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php b/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php index a219e28..792c40a 100644 --- a/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php +++ b/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php @@ -33,7 +33,7 @@ function testStatisticsTokenReplacement() { $headers = array('Content-Type' => 'application/x-www-form-urlencoded'); global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; - $client = \Drupal::httpClientFactory() + $client = \Drupal::service('http_client_factory') ->fromOptions(['config/curl' => [CURLOPT_TIMEOUT => 10]]); $client->post($stats_path, array('headers' => $headers, 'body' => $post)); $statistics = statistics_get($node->id()); diff --git a/core/modules/statistics/src/Tests/Views/IntegrationTest.php b/core/modules/statistics/src/Tests/Views/IntegrationTest.php index a186779..0b8b8c8 100644 --- a/core/modules/statistics/src/Tests/Views/IntegrationTest.php +++ b/core/modules/statistics/src/Tests/Views/IntegrationTest.php @@ -76,7 +76,7 @@ public function testNodeCounterIntegration() { // @see \Drupal\statistics\Tests\StatisticsLoggingTest::testLogging(). global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; - $client = \Drupal::httpClientFactory()->fromOptions(['config/curl', array(CURLOPT_TIMEOUT => 10)]); + $client = \Drupal::service('http_client_factory')->fromOptions(['config/curl', array(CURLOPT_TIMEOUT => 10)]); $client->post($stats_path, array('form_params' => array('nid' => $this->node->id()))); $this->drupalGet('test_statistics_integration');