Fix config usage during install process
This commit is contained in:
parent
5fcb3e4901
commit
71c7669066
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Core\Config\Repository;
|
namespace Friendica\Core\Config\Repository;
|
||||||
|
|
||||||
|
use Friendica\App\Mode;
|
||||||
use Friendica\Core\Config\Exception\ConfigPersistenceException;
|
use Friendica\Core\Config\Exception\ConfigPersistenceException;
|
||||||
use Friendica\Core\Config\Util\ValueConversion;
|
use Friendica\Core\Config\Util\ValueConversion;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
|
@ -32,10 +33,13 @@ class Config
|
||||||
{
|
{
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
protected $db;
|
protected $db;
|
||||||
|
/** @var Mode */
|
||||||
|
protected $mode;
|
||||||
|
|
||||||
public function __construct(Database $db)
|
public function __construct(Database $db, Mode $mode)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
$this->mode = $mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static $table_name = 'config';
|
protected static $table_name = 'config';
|
||||||
|
@ -47,7 +51,7 @@ class Config
|
||||||
*/
|
*/
|
||||||
public function isConnected(): bool
|
public function isConnected(): bool
|
||||||
{
|
{
|
||||||
return $this->db->isConnected();
|
return $this->db->isConnected() && !$this->mode->isInstall();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
namespace Friendica\Core\PConfig\Repository;
|
namespace Friendica\Core\PConfig\Repository;
|
||||||
|
|
||||||
|
use Friendica\App\Mode;
|
||||||
use Friendica\Core\Config\Util\ValueConversion;
|
use Friendica\Core\Config\Util\ValueConversion;
|
||||||
use Friendica\Core\PConfig\Exception\PConfigPersistenceException;
|
use Friendica\Core\PConfig\Exception\PConfigPersistenceException;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
|
@ -34,10 +35,13 @@ class PConfig
|
||||||
|
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
protected $db;
|
protected $db;
|
||||||
|
/** @var Mode */
|
||||||
|
protected $mode;
|
||||||
|
|
||||||
public function __construct(Database $db)
|
public function __construct(Database $db, Mode $mode)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
$this->mode = $mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,7 +51,7 @@ class PConfig
|
||||||
*/
|
*/
|
||||||
public function isConnected(): bool
|
public function isConnected(): bool
|
||||||
{
|
{
|
||||||
return $this->db->isConnected();
|
return $this->db->isConnected() & !$this->mode->isInstall();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user