function Extension::__sleep
Same name in other branches
- 9 core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::__sleep()
- 10 core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::__sleep()
- 11.x core/lib/Drupal/Core/Extension/Extension.php \Drupal\Core\Extension\Extension::__sleep()
Magic method implementation to serialize the extension object.
Return value
array The names of all variables that should be serialized.
File
-
core/
lib/ Drupal/ Core/ Extension/ Extension.php, line 171
Class
- Extension
- Defines an extension (file) object.
Namespace
Drupal\Core\ExtensionCode
public function __sleep() {
// @todo \Drupal\Core\Extension\ThemeExtensionList is adding custom
// properties to the Extension object.
$properties = get_object_vars($this);
// Don't serialize the app root, since this could change if the install is
// moved. Don't serialize splFileInfo because it can not be.
unset($properties['splFileInfo'], $properties['root']);
return array_keys($properties);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.