public function ArchiverManager::createInstance in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Archiver/ArchiverManager.php \Drupal\Core\Archiver\ArchiverManager::createInstance()
Creates a pre-configured instance of a plugin.
Parameters
string $plugin_id: The ID of the plugin being instantiated.
array $configuration: An array of configuration relevant to the plugin instance.
Return value
object A fully configured plugin instance.
Throws
\Drupal\Component\Plugin\Exception\PluginException If the instance cannot be created, such as if the ID is invalid.
Overrides PluginManagerBase::createInstance
1 call to ArchiverManager::createInstance()
- ArchiverManager::getInstance in core/
lib/ Drupal/ Core/ Archiver/ ArchiverManager.php - Gets a preconfigured instance of a plugin.
File
- core/
lib/ Drupal/ Core/ Archiver/ ArchiverManager.php, line 54
Class
- ArchiverManager
- Provides an Archiver plugin manager.
Namespace
Drupal\Core\ArchiverCode
public function createInstance($plugin_id, array $configuration = []) {
$plugin_definition = $this
->getDefinition($plugin_id);
$plugin_class = DefaultFactory::getPluginClass($plugin_id, $plugin_definition, 'Drupal\\Core\\Archiver\\ArchiverInterface');
return new $plugin_class($this->fileSystem
->realpath($configuration['filepath']));
}