Browse Source

Fixing installer

pull/7412/head
Philipp Holzer 2 years ago
parent
commit
a8e6a57e9b
No known key found for this signature in database GPG Key ID: D8365C3D36B77D90
  1. 3
      src/Console/AutomaticInstallation.php
  2. 4
      src/Core/Installer.php
  3. 2
      src/Database/Database.php
  4. 3
      src/Module/Install.php
  5. 2
      tests/DatabaseTest.php

3
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");

4
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')) {

2
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;

3
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

2
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;

Loading…
Cancel
Save