public static DrupalKernel::createFromRequest(Request $request, $class_loader, $environment, $allow_dumping = TRUE,$app_root= NULL)
Create a DrupalKernel object from a request.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The request.
$class_loader: The class loader. Normally Composer's ClassLoader, as included by the front controller, but may also be decorated; e.g., \Symfony\Component\ClassLoader\ApcClassLoader.
string $environment: String indicating the environment, e.g. 'prod' or 'dev'.
bool $allow_dumping: (optional) FALSE to stop the container from being written to or read from disk. Defaults to TRUE.
string $app_root: (optional) The path to the application root as a string. If not supplied, the application root will be computed.
Return value
static
Throws
\Symfony\Component\HttpKernel\Exception\BadRequestHttpException In case the host name in the request is not trusted.
File
- core/lib/Drupal/Core/DrupalKernel.php, line 262
Class
- DrupalKernel
- The DrupalKernel class is the core of Drupal itself.
Namespace
Drupal\Core
Code
1 2 3 4 5 6 | public static function createFromRequest(Request $request , $class_loader , $environment , $allow_dumping = TRUE, $app_root = NULL) { $kernel = new static ( $environment , $class_loader , $allow_dumping , $app_root ); static ::bootEnvironment( $app_root ); $kernel ->initializeSettings( $request ); return $kernel ; } |
Please login to continue.