From: Brion Vibber Date: Fri, 8 Oct 2010 00:02:42 +0000 (-0700) Subject: Add --all option on dumpschema.php to check all core tables X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3c979ec5068ed342fe4fed66c7310923c770793e;p=quix0rs-gnu-social.git Add --all option on dumpschema.php to check all core tables --- diff --git a/scripts/dumpschema.php b/scripts/dumpschema.php index 20812fe5b8..fd44399a9c 100644 --- a/scripts/dumpschema.php +++ b/scripts/dumpschema.php @@ -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')) {