Skip to content

Instantly share code, notes, and snippets.

@msonnabaum
Created June 9, 2010 19:16
Show Gist options
  • Save msonnabaum/432020 to your computer and use it in GitHub Desktop.
Save msonnabaum/432020 to your computer and use it in GitHub Desktop.
<?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);
}
@nclark
Copy link

nclark commented Jun 10, 2010

yo i be selectin this like all the timez yo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment