Is it possible to get a list of all the javascript files in the libraries directory? So far I have tried using files_scan directory but it's not returning anything:
$dir = base_path() . 'sites/all/libraries/';
$files = file_scan_directory($dir, "/.*\.js$/");
dpm($files);
many thanks.
EDIT
I changed to using DRUPAL_ROOT
. This gives the correct path and returns an array of js files but there is a double slash //
in the uri just before the file names: /var/www/html/droop/sites/all/libraries//d3/d3.min.js
$dir = DRUPAL_ROOT . '/sites/all/libraries/';
$files = file_scan_directory($dir, "/.*\.js$/");
dpm($files);