You are here

function blazy_libraries_get_path in Blazy 8.2

Same name and namespace in other branches
  1. 8 blazy.module \blazy_libraries_get_path()

Provides a wrapper to replace deprecated libraries_get_path() at ease.

2 calls to blazy_libraries_get_path()
BlazyAlter::libraryInfoAlter in src/BlazyAlter.php
Implements hook_library_info_alter().
blazy_requirements in ./blazy.install
Implements hook_requirements().

File

./blazy.module, line 161
Provides basic Blazy integration for lazy loading and multi-serving images.

Code

function blazy_libraries_get_path($name, $base_path = FALSE) {
  $function = 'libraries_get_path';
  if (\Drupal::hasService('library.libraries_directory_file_finder')) {
    return \Drupal::service('library.libraries_directory_file_finder')
      ->find($name);
  }
  elseif (is_callable($function)) {
    return $function($name, $base_path);
  }
  return FALSE;
}