ConfigImporter::reInjectMe

protected function ConfigImporter::reInjectMe

protected ConfigImporter::reInjectMe()

Gets all the service dependencies from \Drupal.

Since the ConfigImporter handles module installation the kernel and the container can be rebuilt and altered during processing. It is necessary to keep the services used by the importer in sync.

File

core/lib/Drupal/Core/Config/ConfigImporter.php, line 1039

Class

ConfigImporter
Defines a configuration importer.

Namespace

Drupal\Core\Config

Code

protected function reInjectMe() {
  $this->_serviceIds = array();
  $vars = get_object_vars($this);
  foreach ($vars as $key => $value) {
    if (is_object($value) && isset($value->_serviceId)) {
      $this->$key = \Drupal::service($value->_serviceId);
    }
  }
}

© 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!Core!Config!ConfigImporter.php/function/ConfigImporter::reInjectMe/8.1.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部