mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
DB/Errors
* improve db error handling * web view should always result in an user friendly error if the db connection is missing or erronous * cli use should never fatal if the db connection is erronous. How are you going to fix it, d'uh. * if some CLISetup script requires a db connection check it individually
This commit is contained in:
@@ -130,7 +130,7 @@ class CLISetup
|
||||
self::$localeIds[] = $idx;
|
||||
|
||||
// get site status
|
||||
if (DB::isConnectable(DB_AOWOW))
|
||||
if (DB::isConnected(DB_AOWOW))
|
||||
self::$lock = (int)DB::Aowow()->selectCell('SELECT `value` FROM ?_config WHERE `key` = "maintenance"');
|
||||
else
|
||||
self::$lock = self::LOCK_ON;
|
||||
@@ -199,7 +199,7 @@ class CLISetup
|
||||
|
||||
public static function siteLock(int $mode = self::LOCK_RESTORE) : void
|
||||
{
|
||||
if (DB::isConnectable(DB_AOWOW))
|
||||
if (DB::isConnected(DB_AOWOW))
|
||||
DB::Aowow()->query('UPDATE ?_config SET `value` = ?d WHERE `key` = "maintenance"', (int)!!($mode == self::LOCK_RESTORE ? self::$lock : $mode));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user