mirror of
https://github.com/flarum/core.git
synced 2025-08-08 09:26:34 +02:00
DatabaseConfig: Implement Arrayable contract
This commit is contained in:
@@ -11,7 +11,9 @@
|
||||
|
||||
namespace Flarum\Install;
|
||||
|
||||
class DatabaseConfig
|
||||
use Illuminate\Contracts\Support\Arrayable;
|
||||
|
||||
class DatabaseConfig implements Arrayable
|
||||
{
|
||||
private $driver;
|
||||
private $host;
|
||||
@@ -34,7 +36,7 @@ class DatabaseConfig
|
||||
$this->validate();
|
||||
}
|
||||
|
||||
public function getConfig(): array
|
||||
public function toArray()
|
||||
{
|
||||
return [
|
||||
'driver' => $this->driver,
|
||||
|
@@ -35,7 +35,7 @@ class ConnectToDatabase implements Step
|
||||
|
||||
public function run()
|
||||
{
|
||||
$config = $this->dbConfig->getConfig();
|
||||
$config = $this->dbConfig->toArray();
|
||||
$pdo = (new MySqlConnector)->connect($config);
|
||||
|
||||
$version = $pdo->query('SELECT VERSION()')->fetchColumn();
|
||||
|
@@ -56,7 +56,7 @@ class StoreConfig implements Step, ReversibleStep
|
||||
{
|
||||
return [
|
||||
'debug' => $this->debugMode,
|
||||
'database' => $this->dbConfig->getConfig(),
|
||||
'database' => $this->dbConfig->toArray(),
|
||||
'url' => $this->baseUrl,
|
||||
'paths' => $this->getPathsConfig(),
|
||||
];
|
||||
|
Reference in New Issue
Block a user