You are here

protected function WardenManager::getLibraries in Warden 8

Same name and namespace in other branches
  1. 8.2 src/Service/WardenManager.php \Drupal\warden\Service\WardenManager::getLibraries()
  2. 3.x src/Service/WardenManager.php \Drupal\warden\Service\WardenManager::getLibraries()

Return value

\stdClass[]

1 call to WardenManager::getLibraries()
WardenManager::generateSiteData in src/Service/WardenManager.php
Generate all the site's data for Warden.

File

src/Service/WardenManager.php, line 391

Class

WardenManager
Default controller for the warden module.

Namespace

Drupal\warden\Service

Code

protected function getLibraries() {
  if (!isset($this->libraries)) {

    // Scan the libraries directory for libraries which have been added.
    $libraryDir = \Drupal::root() . '/libraries';
    if (file_exists($libraryDir)) {

      // Scan for package.json files for libraries that have this.
      $listing = file_scan_directory($libraryDir, '/^package.json/');
      $this
        ->setLibraries($listing);
    }
  }
  return $this->libraries;
}