You are here

function _drupalchat_autodiscover_path in DrupalChat 6

Same name and namespace in other branches
  1. 6.2 drupalchat.admin.inc \_drupalchat_autodiscover_path()
  2. 7.2 drupalchat.module \_drupalchat_autodiscover_path()
  3. 7 drupalchat.module \_drupalchat_autodiscover_path()

Autodiscover a system path containing a library.

This will attempt to automatically discover the system path to the folder containing the desired library. It will first search in sites/example.com/libraries, then sites/all/libraries.

Parameters

string $match: The regex pattern to search for.

Return value

string The path to the system folder containing that library.

1 call to _drupalchat_autodiscover_path()
drupalchat_library_path in ./drupalchat.module

File

includes/drupalchat.admin.inc, line 77
Administrative functions to configure DrupalChat.

Code

function _drupalchat_autodiscover_path($match, $filename) {
  $path = '';
  $files = drupal_system_listing($match, 'libraries', 'basename', 0);
  if (isset($files[$filename])) {
    $path = dirname($files[$filename]->filename);
  }
  return $path;
}