diff options
author | Brion Vibber <brion@pobox.com> | 2010-10-15 13:47:38 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-10-15 13:47:38 -0700 |
commit | 90c35dc541b7c2d3ebaa790ce2c0359635652e5a (patch) | |
tree | 237cdfa71f2f71e7d96670a594bfaf7a066d0af4 /lib/schema.php | |
parent | 77300f94a3948dce222e92512d0257beebccf2f8 (diff) |
Cleanup on making the schema work for installer (not quite there yet)
Diffstat (limited to 'lib/schema.php')
-rw-r--r-- | lib/schema.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/schema.php b/lib/schema.php index b5e452a6e..c9a0fb434 100644 --- a/lib/schema.php +++ b/lib/schema.php @@ -448,6 +448,9 @@ class Schema { $ok = true; foreach ($statements as $sql) { + if (defined('DEBUG_INSTALLER')) { + echo "<tt>" . htmlspecialchars($sql) . "</tt><br/>\n"; + } $res = $this->conn->query($sql); if (PEAR::isError($res)) { @@ -478,13 +481,8 @@ class Schema { try { $old = $this->getTableDef($tableName); - } catch (Exception $e) { - // @fixme this is a terrible check :D - if (preg_match('/no such table/', $e->getMessage())) { - return $this->buildCreateTable($tableName, $def); - } else { - throw $e; - } + } catch (SchemaTableMissingException $e) { + return $this->buildCreateTable($tableName, $def); } $old = $this->filterDef($old); |