<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use DOMDocument;
use Exception;
-use Friendica\Core\Config\Cache;
+use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Database\Database;
use Friendica\Database\DBStructure;
use Friendica\DI;
/***
* Installs the DB-Scheme for Friendica
*
- * @param string $basePath The base path of this application
- *
* @return bool true if the installation was successful, otherwise false
* @throws Exception
*/
- public function installDatabase($basePath)
+ public function installDatabase(): bool
{
- $result = DBStructure::install($basePath);
+ $result = DBStructure::install();
if ($result) {
$txt = DI::l10n()->t('You may need to import the file "database.sql" manually using phpmyadmin or mysql.') . EOL;
$cmd = "$phppath -v";
$result = trim(shell_exec($cmd));
$passed2 = (strpos($result, "(cli)") !== false);
- list($result) = explode("\n", $result);
+ [$result] = explode("\n", $result);
$help = "";
if (!$passed2) {
$help .= DI::l10n()->t("PHP executable is not the php cli binary \x28could be cgi-fgci version\x29") . EOL;
);
$returnVal = $returnVal ? $status : false;
+ $status = $this->checkFunction('gmp_strval',
+ DI::l10n()->t('GNU Multiple Precision PHP module'),
+ DI::l10n()->t('Error: GNU Multiple Precision PHP module required but not installed.'),
+ true
+ );
+ $returnVal = $returnVal ? $status : false;
+
return $returnVal;
}
* @return bool true if the check was successful, otherwise false
* @throws Exception
*/
- public function checkDB(Database $dba)
+ public function checkDB(Database $dba): bool
{
$dba->reconnect();
/**
* Setup the default cache for a new installation
*
- * @param Cache $configCache The configuration cache
- * @param string $basePath The determined basepath
+ * @param \Friendica\Core\Config\ValueObject\Cache $configCache The configuration cache
+ * @param string $basePath The determined basepath
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/