Created
June 9, 2010 19:16
-
-
Save msonnabaum/432020 to your computer and use it in GitHub Desktop.
This file contains 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 | |
$result = db_query('SELECT filename, name FROM {system}'); | |
while ($mod = db_fetch_array($result)) { | |
exec('find . -name ' . basename($mod['filename']), $modpath_arr); | |
if (count($modpath_arr) == 1) { | |
$modpath = ltrim($modpath_arr[0], './'); | |
$dbpath = $mod['filename']; | |
if ($dbpath != $modpath) { | |
drush_print("Updating " . $mod['name']. "'s path"); | |
db_query("UPDATE system SET filename='%s' WHERE name='%s'", $modpath, $mod['name']); | |
} | |
} | |
unset($modpath_arr); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yo i be selectin this like all the timez yo