diff --git a/Tina4/Database/Migration.php b/Tina4/Database/Migration.php index 89bb2491..bb5257f1 100644 --- a/Tina4/Database/Migration.php +++ b/Tina4/Database/Migration.php @@ -68,7 +68,9 @@ public function __construct(string $migrationPath = "./migrations", string $deli $this->migrationPath .= "/" . $this->DBA->getShortName(); $this->runRootMigrations = true; } else { - \Tina4\Debug::message("Please upgrade the database driver to include getShortName method for migrations", TINA4_LOG_DEBUG); + if (!method_exists($this->DBA, "getShortName")) { + \Tina4\Debug::message("Please upgrade the database driver to include getShortName method for migrations", TINA4_LOG_DEBUG); + } } //Turn off auto commits so we can roll back @@ -223,6 +225,7 @@ final public function doMigration(): string if ($error) { $result .= "FAILED: \"{$migrationId} {$description}\"\nAll Transactions Rolled Back ...\n"; $this->DBA->rollback($transId); + break; } else { $this->DBA->commit($transId); @@ -248,12 +251,14 @@ final public function doMigration(): string error_reporting(E_ALL); $result .= ""; + + if ($this->runRootMigrations) { //get rid of the database path $this->migrationPath = str_replace("/".$this->DBA->getShortName(), "", $this->migrationPath); $this->runRootMigrations = false; $result .= $this->doMigration(); - + file_put_contents("./log/migrations.html", $result, FILE_APPEND); } return $result; diff --git a/Tina4/Tina4Php.php b/Tina4/Tina4Php.php index a998c654..c27c956c 100644 --- a/Tina4/Tina4Php.php +++ b/Tina4/Tina4Php.php @@ -374,7 +374,7 @@ public function __toString(): string } } } - header("Content-Type: " . $routerResponse->contentType); + header($routerResponse->contentType); http_response_code($routerResponse->httpCode); if ($routerResponse->content === "") { //try give back a response based on the error code - first templates then public