You are here

function modernizr_get_path in Modernizr 8

Same name and namespace in other branches
  1. 7.3 modernizr.module \modernizr_get_path()
  2. 7.2 modernizr.module \modernizr_get_path()

Returns the full path of modernizr, along with the filename.

Return value

string

5 calls to modernizr_get_path()
modernizr_get_filename in ./modernizr.module
Helper function to generate the current filename of the active Modernizr library
modernizr_page_build in ./modernizr.module
Implements hook_page_build().
modernizr_requirements in ./modernizr.install
Implements hook_requirements.
_modernizr_current_build in ./modernizr.module
Helper function to pulls all tests from the current modernizr.js
_modernizr_drush_download_dev in drush/modernizr.drush.inc
Helper function downloads the uncompressed development copy of Modernizr.

File

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

Code

function modernizr_get_path() {
  $path =& drupal_static(__FUNCTION__);
  if ($path === NULL) {
    $paths = array();

    // Check for directory specified in hook_libraries_info()
    if (module_exists('libraries')) {
      $library_path = libraries_get_path('modernizr');
      if (file_exists($library_path)) {
        $paths[] = $library_path;
      }
    }

    // The best location for downloaded libraries is sites/all/libraries.
    if (is_dir('libraries/modernizr')) {
      $paths[] = 'libraries/modernizr';
    }

    // Check inside the module folder itself
    // NOTE: this will be removed in 7.x-3.2
    $paths[] = drupal_get_path('module', 'modernizr');

    // Scan directories for files
    $path = _modernizr_scan_for_library($paths);
  }
  return $path;
}