1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-13 10:04:07 +02:00

Save bytes

This commit is contained in:
Jakub Vrana
2011-08-02 17:46:13 +02:00
parent c91185c435
commit 8e75d54e44
6 changed files with 10 additions and 10 deletions

View File

@@ -444,7 +444,7 @@ if (!defined("DRIVER")) {
$return = array();
$create_table = $connection->result("SHOW CREATE TABLE " . table($table), 1);
if ($create_table) {
preg_match_all("~CONSTRAINT ($pattern) FOREIGN KEY \\(((?:$pattern,? ?)+)\\) REFERENCES ($pattern)(?:\\.($pattern))? \\(((?:$pattern,? ?)+)\\)(?: ON DELETE (" . implode("|", $on_actions) . "))?(?: ON UPDATE (" . implode("|", $on_actions) . "))?~", $create_table, $matches, PREG_SET_ORDER);
preg_match_all("~CONSTRAINT ($pattern) FOREIGN KEY \\(((?:$pattern,? ?)+)\\) REFERENCES ($pattern)(?:\\.($pattern))? \\(((?:$pattern,? ?)+)\\)(?: ON DELETE ($on_actions))?(?: ON UPDATE ($on_actions))?~", $create_table, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
preg_match_all("~$pattern~", $match[2], $source);
preg_match_all("~$pattern~", $match[5], $target);

View File

@@ -284,8 +284,8 @@ ORDER BY conkey, conname") as $row) {
$row['table'] = $match2[2];
}
$row['target'] = array_map('trim', explode(',', $match[3]));
$row['on_delete'] = (preg_match('~ON DELETE (' . implode('|', $on_actions) . ')~', $match[4], $match2) ? $match2[1] : '');
$row['on_update'] = (preg_match('~ON UPDATE (' . implode('|', $on_actions) . ')~', $match[4], $match2) ? $match2[1] : '');
$row['on_delete'] = (preg_match("~ON DELETE ($on_actions)~", $match[4], $match2) ? $match2[1] : '');
$row['on_update'] = (preg_match("~ON UPDATE ($on_actions)~", $match[4], $match2) ? $match2[1] : '');
$return[$row['conname']] = $row;
}
}