mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-29 10:49:22 +02:00
Cleanup
This commit is contained in:
parent
c2516c3b6b
commit
d2dbe2dd72
@ -19,13 +19,15 @@ class DatabaseService
|
|||||||
|
|
||||||
public function connect(): void
|
public function connect(): void
|
||||||
{
|
{
|
||||||
global $config;
|
$configDatabaseOverwrite = config('database_overwrite');
|
||||||
|
|
||||||
if (!isset($config['database_overwrite'])) {
|
if (!isset($configDatabaseOverwrite)) {
|
||||||
$config['database_overwrite'] = false;
|
$configDatabaseOverwrite = false;
|
||||||
|
config(['database_overwrite', false]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$config['database_overwrite'] && !isset($config['database_user'][0], $config['database_password'][0], $config['database_name'][0])) {
|
global $config;
|
||||||
|
if(!$configDatabaseOverwrite) {
|
||||||
if(isset($config['lua']['sqlType'])) {// tfs 0.3
|
if(isset($config['lua']['sqlType'])) {// tfs 0.3
|
||||||
if(isset($config['lua']['mysqlHost'])) {// tfs 0.2
|
if(isset($config['lua']['mysqlHost'])) {// tfs 0.2
|
||||||
$config['otserv_version'] = TFS_02;
|
$config['otserv_version'] = TFS_02;
|
||||||
@ -103,7 +105,6 @@ class DatabaseService
|
|||||||
}
|
}
|
||||||
|
|
||||||
$ots = \POT::getInstance();
|
$ots = \POT::getInstance();
|
||||||
$cache = app()->get('cache');
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$ots->connect([
|
$ots->connect([
|
||||||
@ -133,7 +134,8 @@ class DatabaseService
|
|||||||
|
|
||||||
$eloquentConnection = $capsule->getConnection();
|
$eloquentConnection = $capsule->getConnection();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
if(isset($cache) && $cache->enabled()) {
|
$cache = app()->get('cache');
|
||||||
|
if($cache->enabled()) {
|
||||||
$cache->delete('config_lua');
|
$cache->delete('config_lua');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user