/Drupal 8

class ExtensionDiscovery

Discovers available extensions in the filesystem.

To also discover test modules, add

$settings['extension_discovery_scan_tests'] = TRUE;

to your settings.php.



core/lib/Drupal/Core/Extension/ExtensionDiscovery.php, line 20




Name Modifiers Type Description
ExtensionDiscovery::$fileCache protected property The file cache object.
ExtensionDiscovery::$files protected static property Previously discovered files keyed by origin directory and extension type.
ExtensionDiscovery::$infoParser protected property InfoParser instance for parsing .info.yml files.
ExtensionDiscovery::$profileDirectories protected property List of installation profile directories to additionally scan.
ExtensionDiscovery::$root protected property The app root for the current operation.
ExtensionDiscovery::$sitePath protected property The site path.
ExtensionDiscovery::filterByProfileDirectories protected function Filters out extensions not belonging to the scanned installation profiles.
ExtensionDiscovery::getInfoParser protected function Returns a parser for .info.yml files.
ExtensionDiscovery::getProfileDirectories public function Gets the installation profile directories to be scanned.
ExtensionDiscovery::ORIGIN_CORE constant Origin directory weight: Core.
ExtensionDiscovery::ORIGIN_PARENT_SITE constant Origin directory weight: Parent site directory of a test site environment.
ExtensionDiscovery::ORIGIN_PROFILE constant Origin directory weight: Installation profile.
ExtensionDiscovery::ORIGIN_ROOT constant Origin directory weight: Site-wide directory.
ExtensionDiscovery::ORIGIN_SITE constant Origin directory weight: Site-specific directory.
ExtensionDiscovery::ORIGIN_SITES_ALL constant Origin directory weight: sites/all.
ExtensionDiscovery::PHP_FUNCTION_PATTERN constant Regular expression to match PHP function names.
ExtensionDiscovery::process protected function Processes the filtered and sorted list of extensions.
ExtensionDiscovery::scan public function Discovers available extensions of a given type.
ExtensionDiscovery::scanDirectory protected function Recursively scans a base directory for the requested extension type.
ExtensionDiscovery::setProfileDirectories public function Sets explicit profile directories to scan.
ExtensionDiscovery::setProfileDirectoriesFromSettings public function Sets installation profile directories based on current site settings.
ExtensionDiscovery::sort protected function Sorts the discovered extensions.
ExtensionDiscovery::__construct public function Constructs a new ExtensionDiscovery object.

© 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.