W3cubDocs

/Drupal 8

class OptimizedPhpArrayDumper

OptimizedPhpArrayDumper dumps a service container as a serialized PHP array.

The format of this dumper is very similar to the internal structure of the ContainerBuilder, but based on PHP arrays and \stdClass objects instead of rich value objects for performance reasons.

By removing the abstraction and optimizing some cases like deep collections, fewer classes need to be loaded, fewer function calls need to be executed and fewer run time checks need to be made.

In addition to that, this container dumper treats private services as strictly private with their own private services storage, whereas in the Symfony service container builder and PHP dumper, shared private services can still be retrieved via get() from the container.

It is machine-optimized, for a human-readable version based on this one see \Drupal\Component\DependencyInjection\Dumper\PhpArrayDumper.

Hierarchy

  • class \Symfony\Component\DependencyInjection\Dumper\Dumper implements \Symfony\Component\DependencyInjection\Dumper\DumperInterface

See also

\Drupal\Component\DependencyInjection\Container

File

core/lib/Drupal/Component/DependencyInjection/Dumper/OptimizedPhpArrayDumper.php, line 35

Namespace

Drupal\Component\DependencyInjection\Dumper

Members

Name Modifiers Type Description
Dumper::$container protected property
Dumper::__construct public function Constructor.
OptimizedPhpArrayDumper::$serialize protected property Whether to serialize service definitions or not.
OptimizedPhpArrayDumper::dump public function
OptimizedPhpArrayDumper::dumpCallable protected function Dumps callable to a PHP array.
OptimizedPhpArrayDumper::dumpCollection protected function Dumps a collection to a PHP array.
OptimizedPhpArrayDumper::dumpMethodCalls protected function Dumps method calls to a PHP array.
OptimizedPhpArrayDumper::dumpValue protected function Dumps the value to PHP array format.
OptimizedPhpArrayDumper::escape protected function Escapes parameters.
OptimizedPhpArrayDumper::getAliases protected function Gets the aliases as a PHP array.
OptimizedPhpArrayDumper::getArray public function Gets the service container definition as a PHP array.
OptimizedPhpArrayDumper::getParameterCall protected function Gets a parameter reference in a suitable PHP array format.
OptimizedPhpArrayDumper::getParameters protected function Gets parameters of the container as a PHP array.
OptimizedPhpArrayDumper::getPrivateServiceCall protected function Gets a private service definition in a suitable format.
OptimizedPhpArrayDumper::getReferenceCall protected function Gets a service reference for a reference in a suitable PHP array format.
OptimizedPhpArrayDumper::getServiceCall protected function Gets a service reference for an ID in a suitable PHP array format.
OptimizedPhpArrayDumper::getServiceDefinition protected function Gets a service definition as PHP array.
OptimizedPhpArrayDumper::getServiceDefinitions protected function Gets services of the container as a PHP array.
OptimizedPhpArrayDumper::prepareParameters protected function Prepares parameters for the PHP array dumping.
OptimizedPhpArrayDumper::supportsMachineFormat protected function Whether this supports the machine-optimized format or not.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!DependencyInjection!Dumper!OptimizedPhpArrayDumper.php/class/OptimizedPhpArrayDumper/8.1.x