You are here

function _modernizr_library_search_paths in Modernizr 7.3

Get library search paths.

Original logic was taken from Libraries 7.x-2.3 since it doesn't provide a way to look up its search paths.

See also

libraries_get_libraries()

1 call to _modernizr_library_search_paths()
_modernizr_get_paths in ./modernizr.module
Helper function to scan for acceptably named libraries

File

./modernizr.module, line 256
Main module file for Modernizr

Code

function _modernizr_library_search_paths() {
  $searchdir = array();
  $profile = drupal_get_path('profile', drupal_get_profile());
  $config = conf_path();

  // Similar to 'modules' and 'themes' directories in the root directory,
  // certain distributions may want to place libraries into a 'libraries'
  // directory in Drupal's root directory.
  $searchdir[] = 'libraries';

  // Always search sites/all/libraries.
  $searchdir[] = 'sites/all/libraries';

  // $profile should never be empty in a proper Drupal setup. Check to make sure
  // it exists before adding path.
  if ($profile) {

    // Similar to 'modules' and 'themes' directories inside an installation
    // profile, installation profiles may want to place libraries into a
    // 'libraries' directory.
    $searchdir[] = $profile . '/libraries';
  }

  // $config should never be empty in a proper Drupal setup. Check to make sure
  // it exists before adding path.
  if ($config) {

    // Also search sites/<domain>/*.
    $searchdir[] = $config . '/libraries';
  }
  return $searchdir;
}