Commit 952ee9460cbff7b293809542feb0b859707e52bd
1 parent
ac4d06a5
KTC-861: Zero byte files removed on failed export.
Committed by: Jarrett Jordaan Reviewed by: Megan Watson
Showing
2 changed files
with
3 additions
and
1 deletions
setup/migrate/steps/migrateDatabase.php
| @@ -152,6 +152,8 @@ class migrateDatabase extends Step | @@ -152,6 +152,8 @@ class migrateDatabase extends Step | ||
| 152 | if(!empty($fileContents)) { | 152 | if(!empty($fileContents)) { |
| 153 | $this->sqlDumpFile = realpath($sqlFile); // Store location of dump | 153 | $this->sqlDumpFile = realpath($sqlFile); // Store location of dump |
| 154 | return true; | 154 | return true; |
| 155 | + } else { | ||
| 156 | + unlink($sqlFile); | ||
| 155 | } | 157 | } |
| 156 | } | 158 | } |
| 157 | $noFile = true; | 159 | $noFile = true; |
setup/migrate/steps/migrateInstallation.php
| @@ -128,7 +128,7 @@ class migrateInstallation extends step | @@ -128,7 +128,7 @@ class migrateInstallation extends step | ||
| 128 | 128 | ||
| 129 | public function detectInstallation() { | 129 | public function detectInstallation() { |
| 130 | if(WINDOWS_OS) { | 130 | if(WINDOWS_OS) { |
| 131 | - $knownWindowsLocations = array("C:\Program Files\ktdms"=>"C:\Program Files\ktdms\knowledgeTree\config\config-path","C:\Program Files x86\ktdms"=>"C:\Program Files (x86)\ktdms\knowledgeTree\config\config-path","C:\ktdms"=>"C:\ktdms\knowledgeTree\config\config-path"); | 131 | + $knownWindowsLocations = array("C:\Program Files\ktdms"=>"C:\Program Files\ktdms\knowledgeTree\config\config-path","C:\Program Files (x86)\ktdms"=>"C:\Program Files (x86)\ktdms\knowledgeTree\config\config-path","C:\ktdms"=>"C:\ktdms\knowledgeTree\config\config-path"); |
| 132 | foreach ($knownWindowsLocations as $loc=>$configPath) { | 132 | foreach ($knownWindowsLocations as $loc=>$configPath) { |
| 133 | if(file_exists($configPath)) | 133 | if(file_exists($configPath)) |
| 134 | $this->location = $loc; | 134 | $this->location = $loc; |