You are here

function _drupalchat_autodiscover_path in DrupalChat 7.2

Same name and namespace in other branches
  1. 6.2 drupalchat.admin.inc \_drupalchat_autodiscover_path()
  2. 6 includes/drupalchat.admin.inc \_drupalchat_autodiscover_path()
  3. 7 drupalchat.module \_drupalchat_autodiscover_path()
1 call to _drupalchat_autodiscover_path()
drupalchat_library_path in ./drupalchat.module
@todo Please document this function.

File

./drupalchat.module, line 1026
Module code for DrupalChat.

Code

function _drupalchat_autodiscover_path($match, $filename) {
  $path = '';

  //echo $match;
  $files = drupal_system_listing($match, 'libraries', 'basename', 0);

  /*echo '<pre>'; print_r($files); echo '</pre>';
    die;*/
  foreach ($files as $key => $value) {
    if (preg_match("/{$filename}/i", $key)) {

      /*$path = dirname($value->filename);
        echo $path;
        die;*/
      $path = dirname($value->uri);
    }
  }

  /*echo $filename;
    echo '<pre>'; print_r($files); echo '</pre>';
    if (isset($files[$filename])) {
      echo 'ici';
      $path = dirname($files[$filename]->filename);

    }*/
  return $path;
}