From 8b2f85b5c8474025a44f66eadcbb33cdd5e8e3e3 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 24 Mar 2015 11:49:33 +0000
Subject: [PATCH] Issue #2458045 by webflo: Remove calls to
 core/vendor/autoload.php

---
 autoload.php                                                  | 2 +-
 core/includes/install.core.inc                                | 2 +-
 core/modules/simpletest/src/InstallerTestBase.php             | 2 +-
 core/modules/simpletest/src/KernelTestBase.php                | 2 +-
 core/modules/simpletest/src/WebTestBase.php                   | 2 +-
 .../system/src/Tests/DrupalKernel/DrupalKernelTest.php        | 4 ++--
 .../system/src/Tests/System/IgnoreReplicaSubscriberTest.php   | 2 +-
 core/scripts/migrate-dump-d6.sh                               | 2 +-
 core/scripts/password-hash.sh                                 | 2 +-
 core/scripts/rebuild_token_calculator.sh                      | 2 +-
 core/scripts/run-tests.sh                                     | 0
 core/tests/bootstrap.php                                      | 2 +-
 12 files changed, 12 insertions(+), 12 deletions(-)
 mode change 100644 => 100755 core/scripts/run-tests.sh

diff --git a/autoload.php b/autoload.php
index 690e09f8e9bf..caedb48a19b8 100644
--- a/autoload.php
+++ b/autoload.php
@@ -16,4 +16,4 @@
  * @see core/modules/statistics/statistics.php
  */
 
-return require_once __DIR__ . '/core/vendor/autoload.php';
+return require __DIR__ . '/core/vendor/autoload.php';
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 7e3398645c48..b78fd9d5dab1 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -98,7 +98,7 @@ function install_drupal($class_loader, $settings = array()) {
   //   infrastructure in https://www.drupal.org/node/2389243
   if (is_array($class_loader) && $settings === array()) {
     $settings = $class_loader;
-    $class_loader = require __DIR__ . '/../vendor/autoload.php';
+    $class_loader = require __DIR__ . '/../../autoload.php';
   }
 
   global $install_state;
diff --git a/core/modules/simpletest/src/InstallerTestBase.php b/core/modules/simpletest/src/InstallerTestBase.php
index 11e9076cb5dc..c340c92c02dc 100644
--- a/core/modules/simpletest/src/InstallerTestBase.php
+++ b/core/modules/simpletest/src/InstallerTestBase.php
@@ -140,7 +140,7 @@ protected function setUp() {
 
     // Import new settings.php written by the installer.
     $request = Request::createFromGlobals();
-    $class_loader = require $this->container->get('app.root') . '/core/vendor/autoload.php';
+    $class_loader = require $this->container->get('app.root') . '/autoload.php';
     Settings::initialize($this->container->get('app.root'), DrupalKernel::findSitePath($request), $class_loader);
     foreach ($GLOBALS['config_directories'] as $type => $path) {
       $this->configDirectories[$type] = $path;
diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php
index 14b839b19beb..abc1f20ed755 100644
--- a/core/modules/simpletest/src/KernelTestBase.php
+++ b/core/modules/simpletest/src/KernelTestBase.php
@@ -178,7 +178,7 @@ protected function setUp() {
     $GLOBALS['conf']['container_service_providers']['TestServiceProvider'] = 'Drupal\simpletest\TestServiceProvider';
 
     // Bootstrap a new kernel.
-    $class_loader = require DRUPAL_ROOT . '/core/vendor/autoload.php';
+    $class_loader = require DRUPAL_ROOT . '/autoload.php';
     $this->kernel = new DrupalKernel('testing', $class_loader, FALSE);
     $request = Request::create('/');
     $site_path = DrupalKernel::findSitePath($request);
diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index 63cf76a9e67e..708845609d22 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -862,7 +862,7 @@ protected function setUp() {
     // Since Drupal is bootstrapped already, install_begin_request() will not
     // bootstrap again. Hence, we have to reload the newly written custom
     // settings.php manually.
-    $class_loader = require DRUPAL_ROOT . '/core/vendor/autoload.php';
+    $class_loader = require DRUPAL_ROOT . '/autoload.php';
     Settings::initialize(DRUPAL_ROOT, $this->siteDirectory, $class_loader);
 
     // Execute the non-interactive installer.
diff --git a/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php b/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php
index ebd83075132e..03e56fcdf5d7 100644
--- a/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php
+++ b/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php
@@ -61,7 +61,7 @@ protected function prepareConfigDirectories() {
    */
   protected function getTestKernel(Request $request, array $modules_enabled = NULL, $read_only = FALSE) {
     // Manually create kernel to avoid replacing settings.
-    $class_loader = require DRUPAL_ROOT . '/core/vendor/autoload.php';
+    $class_loader = require DRUPAL_ROOT . '/autoload.php';
     $kernel = DrupalKernel::createFromRequest($request, $class_loader, 'testing');
     $this->settingsSet('container_yamls', []);
     $this->settingsSet('hash_salt', $this->databasePrefix);
@@ -168,7 +168,7 @@ public function testCompileDIC() {
    */
   public function testRepeatedBootWithDifferentEnvironment() {
     $request = Request::createFromGlobals();
-    $class_loader = require DRUPAL_ROOT . '/core/vendor/autoload.php';
+    $class_loader = require DRUPAL_ROOT . '/autoload.php';
 
     $environments = [
       'testing1',
diff --git a/core/modules/system/src/Tests/System/IgnoreReplicaSubscriberTest.php b/core/modules/system/src/Tests/System/IgnoreReplicaSubscriberTest.php
index 3615c43a9a7d..18298f9e94fc 100644
--- a/core/modules/system/src/Tests/System/IgnoreReplicaSubscriberTest.php
+++ b/core/modules/system/src/Tests/System/IgnoreReplicaSubscriberTest.php
@@ -32,7 +32,7 @@ function testSystemInitIgnoresSecondaries() {
     Database::addConnectionInfo('default', 'replica', $connection_info['default']);
 
     db_ignore_replica();
-    $class_loader = require \Drupal::root() . '/core/vendor/autoload.php';
+    $class_loader = require \Drupal::root() . '/autoload.php';
     $kernel = new DrupalKernel('testing', $class_loader, FALSE);
     $event = new GetResponseEvent($kernel, Request::create('http://example.com'), HttpKernelInterface::MASTER_REQUEST);
     $subscriber = new ReplicaDatabaseIgnoreSubscriber();
diff --git a/core/scripts/migrate-dump-d6.sh b/core/scripts/migrate-dump-d6.sh
index 11e05c579610..6d9b3660e86e 100755
--- a/core/scripts/migrate-dump-d6.sh
+++ b/core/scripts/migrate-dump-d6.sh
@@ -29,7 +29,7 @@
   return;
 }
 
-$autoloader  = require __DIR__ . '/../vendor/autoload.php';
+$autoloader  = require __DIR__ . '/../../autoload.php';
 require_once __DIR__ . '/../includes/bootstrap.inc';
 
 $request = Request::createFromGlobals();
diff --git a/core/scripts/password-hash.sh b/core/scripts/password-hash.sh
index b1cfa2f9da59..cf5e9e382468 100755
--- a/core/scripts/password-hash.sh
+++ b/core/scripts/password-hash.sh
@@ -55,7 +55,7 @@
 // Password list to be processed.
 $passwords = $_SERVER['argv'];
 
-$autoloader = require __DIR__ . '/../vendor/autoload.php';
+$autoloader = require __DIR__ . '/../../autoload.php';
 
 $request = Request::createFromGlobals();
 $kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod', FALSE);
diff --git a/core/scripts/rebuild_token_calculator.sh b/core/scripts/rebuild_token_calculator.sh
index 87c306995e6c..38a64ab119c0 100755
--- a/core/scripts/rebuild_token_calculator.sh
+++ b/core/scripts/rebuild_token_calculator.sh
@@ -15,7 +15,7 @@
   return;
 }
 
-require __DIR__ . '/../vendor/autoload.php';
+require __DIR__ . '/../../autoload.php';
 require_once __DIR__ . '/../includes/bootstrap.inc';
 
 $request = Request::createFromGlobals();
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
old mode 100644
new mode 100755
diff --git a/core/tests/bootstrap.php b/core/tests/bootstrap.php
index 76f745cf8178..d0512e108203 100644
--- a/core/tests/bootstrap.php
+++ b/core/tests/bootstrap.php
@@ -68,7 +68,7 @@ function drupal_phpunit_register_extension_dirs(Composer\Autoload\ClassLoader $l
 }
 
 // Start with classes in known locations.
-$loader = require __DIR__ . '/../vendor/autoload.php';
+$loader = require __DIR__ . '/../../autoload.php';
 $loader->add('Drupal\\Tests', __DIR__);
 
 // Scan for arbitrary extension namespaces from core and contrib.
-- 
GitLab