Fix config usage during install process

This commit is contained in:
Philipp 2022-01-23 20:08:48 +01:00
parent 5fcb3e4901
commit 71c7669066
No known key found for this signature in database
GPG Key ID: 24A7501396EB5432
2 changed files with 14 additions and 6 deletions

View File

@ -21,6 +21,7 @@
namespace Friendica\Core\Config\Repository;
use Friendica\App\Mode;
use Friendica\Core\Config\Exception\ConfigPersistenceException;
use Friendica\Core\Config\Util\ValueConversion;
use Friendica\Database\Database;
@ -32,10 +33,13 @@ class Config
{
/** @var Database */
protected $db;
/** @var Mode */
protected $mode;
public function __construct(Database $db)
public function __construct(Database $db, Mode $mode)
{
$this->db = $db;
$this->mode = $mode;
}
protected static $table_name = 'config';
@ -47,7 +51,7 @@ class Config
*/
public function isConnected(): bool
{
return $this->db->isConnected();
return $this->db->isConnected() && !$this->mode->isInstall();
}
/**

View File

@ -21,6 +21,7 @@
namespace Friendica\Core\PConfig\Repository;
use Friendica\App\Mode;
use Friendica\Core\Config\Util\ValueConversion;
use Friendica\Core\PConfig\Exception\PConfigPersistenceException;
use Friendica\Database\Database;
@ -34,10 +35,13 @@ class PConfig
/** @var Database */
protected $db;
/** @var Mode */
protected $mode;
public function __construct(Database $db)
public function __construct(Database $db, Mode $mode)
{
$this->db = $db;
$this->mode = $mode;
}
/**
@ -47,7 +51,7 @@ class PConfig
*/
public function isConnected(): bool
{
return $this->db->isConnected();
return $this->db->isConnected() & !$this->mode->isInstall();
}
/**