function ExtensionList::setPathname

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Extension/ExtensionList.php \Drupal\Core\Extension\ExtensionList::setPathname()
  2. 10 core/lib/Drupal/Core/Extension/ExtensionList.php \Drupal\Core\Extension\ExtensionList::setPathname()
  3. 9 core/lib/Drupal/Core/Extension/ExtensionList.php \Drupal\Core\Extension\ExtensionList::setPathname()
  4. 8.9.x core/lib/Drupal/Core/Extension/ExtensionList.php \Drupal\Core\Extension\ExtensionList::setPathname()

Sets the pathname for an extension.

This method is used in the Drupal bootstrapping phase, when the extension system is not fully initialized, to manually set locations of modules and profiles needed to complete bootstrapping.

It is not recommended to call this method except in those rare cases.

@internal

Parameters

string $extension_name: The machine name of the extension.

string $pathname: The pathname of the extension which is to be set explicitly rather than by consulting the dynamic extension listing.

Deprecated

in drupal:11.5.0 and is removed from drupal:13.0.0. There is no replacement.

See also

::getPathname

https://www.drupal.org/node/2934063

1 method overrides ExtensionList::setPathname()
DatabaseDriverList::setPathname in core/lib/Drupal/Core/Extension/DatabaseDriverList.php
Sets the pathname for an extension.

File

core/lib/Drupal/Core/Extension/ExtensionList.php, line 492

Class

ExtensionList
Provides available extensions.

Namespace

Drupal\Core\Extension

Code

public function setPathname($extension_name, $pathname) {
  @trigger_error(__METHOD__ . '() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. There is no replacement. See https://www.drupal.org/node/2934063', E_USER_DEPRECATED);
  $this->addedPathNames[$extension_name] = $pathname;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.