AppRootFactory.php in Zircon Profile 8.0
Same filename and directory in other branches
Contains \Drupal\Core\AppRootFactory.
Namespace
Drupal\CoreFile
core/lib/Drupal/Core/AppRootFactory.phpView source
<?php
/**
* @file
* Contains \Drupal\Core\AppRootFactory.
*/
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
*/
public function get() {
return $this->drupalKernel
->getAppRoot();
}
}
Classes
Name | Description |
---|---|
AppRootFactory | Gets the app root from the kernel. |