mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-30 21:21:09 -04:00 
			
		
		
		
	fix database connection issue
This commit is contained in:
		| @ -49,20 +49,22 @@ class EnvironmentManager | ||||
|             'DB_PASSWORD='.$request->database_password."\n\n"; | ||||
|  | ||||
|         try { | ||||
|             if ($this->checkDatabaseConnection($request)) { | ||||
|                 if(\Schema::hasTable('users') ) { | ||||
|                     return [ | ||||
|                         'error' => 'database_should_be_empty' | ||||
|                     ]; | ||||
|                 } | ||||
|  | ||||
|             $this->checkDatabaseConnection($request); | ||||
|  | ||||
|             if(\Schema::hasTable('users') ) { | ||||
|                 return [ | ||||
|                     'error' => 'database_should_be_empty' | ||||
|                 ]; | ||||
|             } | ||||
|  | ||||
|         } catch (Exception $e) { | ||||
|  | ||||
|             return [ | ||||
|                 'error' => $e->getMessage() | ||||
|             ]; | ||||
|         } | ||||
|  | ||||
|  | ||||
|         try { | ||||
|  | ||||
|             file_put_contents($this->envPath, str_replace( | ||||
| @ -120,8 +122,6 @@ class EnvironmentManager | ||||
|                 ); | ||||
|             } | ||||
|  | ||||
|  | ||||
|  | ||||
|         } catch (Exception $e) { | ||||
|             return [ | ||||
|                 'error' => 'mail_variables_save_error' | ||||
| @ -318,12 +318,6 @@ class EnvironmentManager | ||||
|             ], | ||||
|         ]); | ||||
|  | ||||
|         try { | ||||
|             DB::connection()->getPdo(); | ||||
|  | ||||
|             return true; | ||||
|         } catch (Exception $e) { | ||||
|             return $e; | ||||
|         } | ||||
|         return DB::connection()->getPdo(); | ||||
|     } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user