Last active
March 5, 2016 00:17
-
-
Save greggles/842ee2dd34b406b0ac83 to your computer and use it in GitHub Desktop.
Finds Drupal files by name and lists out where they are being used (i.e. what nodes or users are associated with it)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fid = db_query("SELECT fid FROM {file_managed} WHERE filename = 'card-1.xls'")->fetchField(); | |
if ($fid) { | |
$file = file_load($fid); | |
var_dump(file_usage_list($file)); | |
} | |
else { | |
echo "no file found"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment