Commit 8438ad61 authored by catch's avatar catch
Browse files

Issue #3293431 by longwave: Remove obsolete AppRootFactory and SitePathFactory

(cherry picked from commit 9abad5716084f2ec3a27c6597c16abb0311897e6)
parent beb9503c
Loading
Loading
Loading
Loading
+0 −37
Original line number Diff line number Diff line
<?php

namespace Drupal\Core;

/**
 * Gets the app root from the kernel.
 */
class AppRootFactory {

  /**
   * The Drupal kernel.
   *
   * @var \Drupal\Core\DrupalKernelInterface
   */
  protected $drupalKernel;

  /**
   * Constructs an AppRootFactory instance.
   *
   * @param \Drupal\Core\DrupalKernelInterface $drupal_kernel
   *   The Drupal kernel.
   */
  public function __construct(DrupalKernelInterface $drupal_kernel) {
    $this->drupalKernel = $drupal_kernel;
  }

  /**
   * Gets the app root.
   *
   * @return string
   *   The app root.
   */
  public function get() {
    return $this->drupalKernel->getContainer()->getParameter('app.root');
  }

}
+0 −37
Original line number Diff line number Diff line
<?php

namespace Drupal\Core;

/**
 * Gets the site path from the kernel.
 */
class SitePathFactory {

  /**
   * The Drupal kernel.
   *
   * @var \Drupal\Core\DrupalKernelInterface
   */
  protected $drupalKernel;

  /**
   * Constructs a SitePathFactory instance.
   *
   * @param \Drupal\Core\DrupalKernelInterface $drupal_kernel
   *   The Drupal kernel.
   */
  public function __construct(DrupalKernelInterface $drupal_kernel) {
    $this->drupalKernel = $drupal_kernel;
  }

  /**
   * Gets the site path.
   *
   * @return string
   *   The site path.
   */
  public function get() {
    return $this->drupalKernel->getContainer()->getParameter('site.path');
  }

}