本文整理匯總了PHP中Drupal\Core\Extension\ExtensionDiscovery::setProfileDirectoriesFromSettings方法的典型用法代碼示例。如果您正苦於以下問題:PHP ExtensionDiscovery::setProfileDirectoriesFromSettings方法的具體用法?PHP ExtensionDiscovery::setProfileDirectoriesFromSettings怎麽用?PHP ExtensionDiscovery::setProfileDirectoriesFromSettings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Drupal\Core\Extension\ExtensionDiscovery
的用法示例。
在下文中一共展示了ExtensionDiscovery::setProfileDirectoriesFromSettings方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAllModules
/**
* {@inheritdoc}
*/
public function getAllModules()
{
static $modules;
if (!isset($modules)) {
// ModuleHandler::getModuleDirectories() returns data only for installed
// modules. system_rebuild_module_data() includes only the site's install
// profile directory, while we may need to include a custom profile.
// @see _system_rebuild_module_data().
$listing = new ExtensionDiscovery($this->root);
$profile_directories = $listing->setProfileDirectoriesFromSettings()->getProfileDirectories();
$installed_profile = $this->drupalGetProfile();
if (isset($bundle) && $bundle->isProfile()) {
$profile_directory = 'profiles/' . $bundle->getProfileName();
if ($bundle->getProfileName() != $installed_profile && is_dir($profile_directory)) {
$profile_directories[] = $profile_directory;
}
}
$listing->setProfileDirectories($profile_directories);
// Find modules.
$modules = $listing->scan('module');
// Find installation profiles.
$profiles = $listing->scan('profile');
foreach ($profiles as $key => $profile) {
$modules[$key] = $profile;
}
}
return $modules;
}