You are here

function _less_lessphp_locate in Less CSS Preprocessor 7.3

Same name and namespace in other branches
  1. 8 includes/less.libraries.inc \_less_lessphp_locate()
  2. 7.4 includes/less.libraries.inc \_less_lessphp_locate()

Locates leafo/lessphp in the many possible places it could be.

Parameters

array $library: Libraries definition array.

1 call to _less_lessphp_locate()
less_libraries_info in ./less.libraries.inc
Implements hook_libraries_info().

File

./less.libraries.inc, line 136
Contains Libraries API integration.

Code

function _less_lessphp_locate(&$library) {
  $locations = array();

  // Primary libraries location
  $locations[] = libraries_get_path('lessphp');

  // Legacy bundled location
  $locations[] = drupal_get_path('module', 'less') . '/lessphp';

  // Composer location
  $locations[] = drupal_get_path('module', 'less') . '/vendor/leafo/lessphp';

  /*
   * oyejorge/less.php does not have the actual version number in lessc.inc.php,
   * so we don't have to worry about mistaken identity.
   */
  $version_files = array(
    'lessc.inc.php' => 'lessc.inc.php',
  );
  _less_libraries_determine_location($library, $locations, $version_files);
}