Change record status: 
Project: 
Introduced in branch: 
8.0.x
Description: 

The container is now stored as a dumped PHP array definition in the database instead of as a compiled PHP file in the filesystem (using PHP Storage).

To debug the container used by Drupal:

Before:

$ view sites/default/files/php/service_container/*/*.php

After (e.g. from docroot, if not adjust path to autoloader):

Simple

drush ev '$container_definition = Drupal::service("kernel")->getCachedContainerDefinition(); print_r($container_definition);'

With unserialized service definitions

drush ev '$container_definition = Drupal::service("kernel")->getCachedContainerDefinition(); foreach ($container_definition["services"] as $name => $definition) { $container_definition["services"][$name] = unserialize($definition); }; print_r($container_definition);'

More powerful, but complex


use Drupal\Core\DrupalKernel;
use Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper;
use Symfony\Component\HttpFoundation\Request;

if (PHP_SAPI !== 'cli') {
  return;
}

$autoloader = require_once "autoload.php";

$request = Request::createFromGlobals();

// Do not allow to dump the container.
$kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod', FALSE);
$kernel->boot();

// Ensure we retrieve a container builder.
$container_builder = $kernel->rebuildContainer();

// Dump the whole container in a human-readable format.
$dumper = new PhpArrayDumper($container_builder);
$container_definition = $dumper->getArray();

print_r($container_definition);

Also see:

Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done