Loading bs_base.drush.inc +16 −2 Original line number Diff line number Diff line Loading @@ -5,10 +5,13 @@ * BS Base drush integration offering various theme management function. */ use Drupal\Core\DrupalKernel; use Drupal\Core\Extension\ExtensionDiscovery; use Drush\Log\LogLevel; use Drupal\Component\Serialization\Yaml; use Drupal\Core\Extension\Discovery\RecursiveExtensionFilterIterator; use Drupal\Core\Site\Settings; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Generator\UrlGenerator; /** Loading Loading @@ -493,8 +496,18 @@ function _bs_base_drupal_scan($type, $reset = FALSE) { return $processed_files; } $searchdirs = [ ExtensionDiscovery::ORIGIN_SITES_ALL => 'sites/all', ExtensionDiscovery::ORIGIN_ROOT => '' ]; if (\Drupal::hasService('kernel')) { $searchdirs[ExtensionDiscovery::ORIGIN_SITE] = \Drupal::service('site.path'); } else { $searchdirs[ExtensionDiscovery::ORIGIN_SITE] = DrupalKernel::findSitePath(Request::createFromGlobals()); } $files = []; static $searchdirs = ['core', 'sites/all', '']; foreach ($searchdirs as $dir) { $scan_res = _bs_base_drupal_scan_directory($dir); // Only return extensions of the requested type. Loading Loading @@ -590,7 +603,8 @@ function _bs_base_drupal_scan_directory($dir) { $extension->type = $type; $extension->pathname = $pathname; $extension->filename = $filename; $extension->subpath = $fileinfo->getSubPath(); // Add dir to subpath so we can work with multisites also. $extension->subpath = (!empty($dir) ? $dir . '/' : '') . $fileinfo->getSubPath(); // Extension parent folder path. $extension->parentPath = substr($fileinfo->getPath(), 0, -(strlen($name) + 1)); $extension->origin = $dir; Loading Loading
bs_base.drush.inc +16 −2 Original line number Diff line number Diff line Loading @@ -5,10 +5,13 @@ * BS Base drush integration offering various theme management function. */ use Drupal\Core\DrupalKernel; use Drupal\Core\Extension\ExtensionDiscovery; use Drush\Log\LogLevel; use Drupal\Component\Serialization\Yaml; use Drupal\Core\Extension\Discovery\RecursiveExtensionFilterIterator; use Drupal\Core\Site\Settings; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Generator\UrlGenerator; /** Loading Loading @@ -493,8 +496,18 @@ function _bs_base_drupal_scan($type, $reset = FALSE) { return $processed_files; } $searchdirs = [ ExtensionDiscovery::ORIGIN_SITES_ALL => 'sites/all', ExtensionDiscovery::ORIGIN_ROOT => '' ]; if (\Drupal::hasService('kernel')) { $searchdirs[ExtensionDiscovery::ORIGIN_SITE] = \Drupal::service('site.path'); } else { $searchdirs[ExtensionDiscovery::ORIGIN_SITE] = DrupalKernel::findSitePath(Request::createFromGlobals()); } $files = []; static $searchdirs = ['core', 'sites/all', '']; foreach ($searchdirs as $dir) { $scan_res = _bs_base_drupal_scan_directory($dir); // Only return extensions of the requested type. Loading Loading @@ -590,7 +603,8 @@ function _bs_base_drupal_scan_directory($dir) { $extension->type = $type; $extension->pathname = $pathname; $extension->filename = $filename; $extension->subpath = $fileinfo->getSubPath(); // Add dir to subpath so we can work with multisites also. $extension->subpath = (!empty($dir) ? $dir . '/' : '') . $fileinfo->getSubPath(); // Extension parent folder path. $extension->parentPath = substr($fileinfo->getPath(), 0, -(strlen($name) + 1)); $extension->origin = $dir; Loading