Upgraded drupal core with security updates
[yaffs-website] / web / core / lib / Drupal / Core / SitePathFactory.php
1 <?php
2
3 namespace Drupal\Core;
4
5 /**
6  * Gets the site path from the kernel.
7  */
8 class SitePathFactory {
9
10   /**
11    * The Drupal kernel.
12    *
13    * @var \Drupal\Core\DrupalKernelInterface
14    */
15   protected $drupalKernel;
16
17   /**
18    * Constructs an SitePathFactory instance.
19    *
20    * @param \Drupal\Core\DrupalKernelInterface $drupal_kernel
21    *   The Drupal kernel.
22    */
23   public function __construct(DrupalKernelInterface $drupal_kernel) {
24     $this->drupalKernel = $drupal_kernel;
25   }
26
27   /**
28    * Gets the site path.
29    *
30    * @return string
31    *   The site path.
32    */
33   public function get() {
34     return $this->drupalKernel->getSitePath();
35   }
36
37 }