function _drupalchat_autodiscover_path in DrupalChat 6
Same name and namespace in other branches
- 6.2 drupalchat.admin.inc \_drupalchat_autodiscover_path()
- 7.2 drupalchat.module \_drupalchat_autodiscover_path()
- 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()
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;
}