You are here

public function FontAwesomeManager::getMetadataFilepath in Font Awesome Icons 8.2

Returns the FontAwesome icon metadata file path.

Return value

string The filepath of the metadata file.

Overrides FontAwesomeManagerInterface::getMetadataFilepath

1 call to FontAwesomeManager::getMetadataFilepath()
FontAwesomeManager::getMetadata in src/FontAwesomeManager.php
Loads the Font Awesome icon metadata.

File

src/FontAwesomeManager.php, line 286

Class

FontAwesomeManager
Icon Manager Service for Font Awesome.

Namespace

Drupal\fontawesome

Code

public function getMetadataFilepath() {

  // Attempt to load the icons from the local library's metadata if possible.
  $metadataFile = $this->fileSystem
    ->realpath(DRUPAL_ROOT . '/libraries/fontawesome/metadata/icons.yml');

  // If we can't load the local file, use the included module icons file.
  if (!file_exists($metadataFile)) {
    $metadataFile = drupal_get_path('module', 'fontawesome') . '/metadata/icons.yml';
  }
  return $metadataFile;
}