Add --all option on dumpschema.php to check all core tables

This commit is contained in:
Brion Vibber 2010-10-07 17:02:42 -07:00
parent cc69ede1ee
commit 3c979ec506

View File

@ -25,7 +25,7 @@ Attempt to pull a schema definition for a given table.
END_OF_CHECKSCHEMA_HELP;
$longoptions = array('diff');
$longoptions = array('diff', 'all');
require_once INSTALLDIR.'/scripts/commandline.inc';
function indentOptions($indent)
@ -87,6 +87,13 @@ function getCoreSchema($tableName)
return $schema[$tableName];
}
function getCoreTables()
{
$schema = array();
include INSTALLDIR . '/db/core.php';
return array_keys($schema);
}
function dumpTable($tableName, $live)
{
if ($live) {
@ -117,6 +124,10 @@ function showDiff($a, $b)
unlink($fnameB);
}
if (have_option('all')) {
$args = getCoreTables();
}
if (count($args)) {
foreach ($args as $tableName) {
if (have_option('diff')) {