mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
fix database connection issue
This commit is contained in:
@ -49,20 +49,22 @@ class EnvironmentManager
|
|||||||
'DB_PASSWORD='.$request->database_password."\n\n";
|
'DB_PASSWORD='.$request->database_password."\n\n";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($this->checkDatabaseConnection($request)) {
|
|
||||||
|
$this->checkDatabaseConnection($request);
|
||||||
|
|
||||||
if(\Schema::hasTable('users') ) {
|
if(\Schema::hasTable('users') ) {
|
||||||
return [
|
return [
|
||||||
'error' => 'database_should_be_empty'
|
'error' => 'database_should_be_empty'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'error' => $e->getMessage()
|
'error' => $e->getMessage()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
file_put_contents($this->envPath, str_replace(
|
file_put_contents($this->envPath, str_replace(
|
||||||
@ -120,8 +122,6 @@ class EnvironmentManager
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return [
|
return [
|
||||||
'error' => 'mail_variables_save_error'
|
'error' => 'mail_variables_save_error'
|
||||||
@ -318,12 +318,6 @@ class EnvironmentManager
|
|||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
try {
|
return DB::connection()->getPdo();
|
||||||
DB::connection()->getPdo();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} catch (Exception $e) {
|
|
||||||
return $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -206,10 +206,10 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
window.toastr['error'](this.$t('wizard.errors.' + response.data.error))
|
window.toastr['error'](this.$t('wizard.errors.' + response.data.error))
|
||||||
}
|
}
|
||||||
this.loading = false
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e.response)
|
|
||||||
window.toastr['error'](e.response.data.message)
|
window.toastr['error'](e.response.data.message)
|
||||||
|
} finally {
|
||||||
|
this.loading = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user