mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-19 11:14:06 +00:00
Improvements to the Install Utilities
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace InvoiceShelf\Space;
|
namespace InvoiceShelf\Space;
|
||||||
|
|
||||||
|
use Illuminate\Database\QueryException;
|
||||||
use League\Flysystem\FilesystemException;
|
use League\Flysystem\FilesystemException;
|
||||||
|
|
||||||
class InstallUtils
|
class InstallUtils
|
||||||
@@ -13,7 +14,7 @@ class InstallUtils
|
|||||||
*/
|
*/
|
||||||
public static function isDbCreated()
|
public static function isDbCreated()
|
||||||
{
|
{
|
||||||
return self::tableExists('users');
|
return self::dbMarkerExists() && self::tableExists('users');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,19 +31,14 @@ class InstallUtils
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$flag = self::dbMarkerExists();
|
$flag = \Schema::hasTable($table);
|
||||||
if ($flag) {
|
} catch (QueryException|\Exception $e) {
|
||||||
$flag &= \Schema::hasTable($table);
|
|
||||||
}
|
|
||||||
} catch (\Illuminate\Database\QueryException $e) {
|
|
||||||
$flag = false;
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
$flag = false;
|
$flag = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$cache[$table] = $flag;
|
$cache[$table] = $flag;
|
||||||
|
|
||||||
return $flag;
|
return $cache[$table];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -68,7 +64,7 @@ class InstallUtils
|
|||||||
*/
|
*/
|
||||||
public static function createDbMarker()
|
public static function createDbMarker()
|
||||||
{
|
{
|
||||||
\Storage::disk('local')->put('database_created', 'database_created');
|
\Storage::disk('local')->put('database_created', time());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user