Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Core/SitePathFactory.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
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 } |