From: Philipp Holzer Date: Sat, 20 Jul 2019 23:30:28 +0000 (+0200) Subject: Fixing installer X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a8e6a57e9b955989f8fd7a7c7d530366d3774eda;p=friendica.git Fixing installer --- diff --git a/src/Console/AutomaticInstallation.php b/src/Console/AutomaticInstallation.php index 401d9c292c..d594b2605e 100644 --- a/src/Console/AutomaticInstallation.php +++ b/src/Console/AutomaticInstallation.php @@ -79,7 +79,8 @@ HELP; $installer = new Installer(); $configCache = $a->getConfigCache(); - $installer->setUpCache($configCache, BasePath::create($a->getBasePath(), $_SERVER)); + $basepath = new BasePath($a->getBasePath()); + $installer->setUpCache($configCache, $basepath->getPath()); $this->out(" Complete!\n\n"); diff --git a/src/Core/Installer.php b/src/Core/Installer.php index de041773ef..8163d546ad 100644 --- a/src/Core/Installer.php +++ b/src/Core/Installer.php @@ -7,8 +7,8 @@ namespace Friendica\Core; use DOMDocument; use Exception; use Friendica\Core\Config\Cache\ConfigCache; +use Friendica\Database\Database; use Friendica\Database\DBStructure; -use Friendica\Factory\DBFactory; use Friendica\Object\Image; use Friendica\Util\Logger\VoidLogger; use Friendica\Util\Network; @@ -600,7 +600,7 @@ class Installer */ public function checkDB(ConfigCache $configCache, Profiler $profiler) { - $database = DBFactory::init($configCache, $profiler, [], new VoidLogger()); + $database = new Database($configCache, $profiler, new VoidLogger()); if ($database->connected()) { if (DBStructure::existsTable('user')) { diff --git a/src/Database/Database.php b/src/Database/Database.php index cdd5a357ab..495e7d93d5 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -46,7 +46,7 @@ class Database private $in_retrial = false; private $relation = []; - public function __construct(ConfigCache $configCache, Profiler $profiler, LoggerInterface $logger, array $server) + public function __construct(ConfigCache $configCache, Profiler $profiler, LoggerInterface $logger, array $server = []) { // We are storing these values for being able to perform a reconnect $this->configCache = $configCache; diff --git a/src/Module/Install.php b/src/Module/Install.php index 54c6141cc7..a7427ead0d 100644 --- a/src/Module/Install.php +++ b/src/Module/Install.php @@ -67,7 +67,8 @@ class Install extends BaseModule // get basic installation information and save them to the config cache $configCache = $a->getConfigCache(); - self::$installer->setUpCache($configCache, BasePath::create($a->getBasePath(), $_SERVER)); + $basePath = new BasePath($a->getBasePath()); + self::$installer->setUpCache($configCache, $basePath->getPath()); // We overwrite current theme css, because during install we may not have a working mod_rewrite // so we may not have a css at all. Here we set a static css file for the install procedure pages diff --git a/tests/DatabaseTest.php b/tests/DatabaseTest.php index 4dffc56878..5f9d3bf72c 100644 --- a/tests/DatabaseTest.php +++ b/tests/DatabaseTest.php @@ -9,8 +9,6 @@ use Friendica\App\Mode; use Friendica\Core\Config\Cache\ConfigCache; use Friendica\Database\Database; use Friendica\Factory\ConfigFactory; -use Friendica\Factory\DBFactory; -use Friendica\Factory\ProfilerFactory; use Friendica\Util\BasePath; use Friendica\Util\ConfigFileLoader; use Friendica\Util\Profiler;