use Friendica\Core\Config;
use Friendica\Core\Installer;
use Friendica\Core\Theme;
-use Friendica\Database\DBA;
-use Friendica\Database\DBStructure;
use RuntimeException;
-require_once 'include/dba.php';
-
class AutomaticInstallation extends Console
{
protected function getHelp()
}
}
- $db_host = $a->getConfigValue('database', 'hostname');
- $db_user = $a->getConfigValue('database', 'username');
- $db_pass = $a->getConfigValue('database', 'password');
- $db_data = $a->getConfigValue('database', 'database');
+ $db_host = $a->getConfigCache()->get('database', 'hostname');
+ $db_user = $a->getConfigCache()->get('database', 'username');
+ $db_pass = $a->getConfigCache()->get('database', 'password');
+ $db_data = $a->getConfigCache()->get('database', 'database');
} else {
// Creating config file
$this->out("Creating config file...\n");
$db_data = $this->getOption(['d', 'dbdata'], ($save_db) ? getenv('MYSQL_DATABASE') : '');
$db_user = $this->getOption(['U', 'dbuser'], ($save_db) ? getenv('MYSQL_USER') . getenv('MYSQL_USERNAME') : '');
$db_pass = $this->getOption(['P', 'dbpass'], ($save_db) ? getenv('MYSQL_PASSWORD') : '');
- $url_path = $this->getOption(['u', 'urlpath'], (!empty('FRIENDICA_URL_PATH')) ? getenv('FRIENDICA_URL_PATH') : null);
- $php_path = $this->getOption(['b', 'phppath'], (!empty('FRIENDICA_PHP_PATH')) ? getenv('FRIENDICA_PHP_PATH') : null);
- $admin_mail = $this->getOption(['A', 'admin'], (!empty('FRIENDICA_ADMIN_MAIL')) ? getenv('FRIENDICA_ADMIN_MAIL') : '');
- $tz = $this->getOption(['T', 'tz'], (!empty('FRIENDICA_TZ')) ? getenv('FRIENDICA_TZ') : '');
- $lang = $this->getOption(['L', 'lang'], (!empty('FRIENDICA_LANG')) ? getenv('FRIENDICA_LANG') : '');
+ $url_path = $this->getOption(['u', 'urlpath'], !empty('FRIENDICA_URL_PATH') ? getenv('FRIENDICA_URL_PATH') : null);
+ $php_path = $this->getOption(['b', 'phppath'], !empty('FRIENDICA_PHP_PATH') ? getenv('FRIENDICA_PHP_PATH') : null);
+ $admin_mail = $this->getOption(['A', 'admin'], !empty('FRIENDICA_ADMIN_MAIL') ? getenv('FRIENDICA_ADMIN_MAIL') : '');
+ $tz = $this->getOption(['T', 'tz'], !empty('FRIENDICA_TZ') ? getenv('FRIENDICA_TZ') : '');
+ $lang = $this->getOption(['L', 'lang'], !empty('FRIENDICA_LANG') ? getenv('FRIENDICA_LANG') : '');
if (empty($php_path)) {
$php_path = $installer->getPHPPath();
$installer->createConfig(
$php_path,
$url_path,
- ((!empty($db_port)) ? $db_host . ':' . $db_port : $db_host),
+ (!empty($db_port) ? $db_host . ':' . $db_port : $db_host),
$db_user,
$db_pass,
$db_data,
$installer->resetChecks();
- if (!$installer->checkDB($db_host, $db_user, $db_pass, $db_data)) {
+ if (!$installer->checkDB($a->getBasePath(), $a->getConfigCache(), $a->getProfiler(), $db_host, $db_user, $db_pass, $db_data)) {
$errorMessage = $this->extractErrors($installer->getChecks());
throw new RuntimeException($errorMessage);
}
$installer->resetChecks();
- if (!$installer->installDatabase()) {
+ if (!$installer->installDatabase($a->getBasePath())) {
$errorMessage = $this->extractErrors($installer->getChecks());
throw new RuntimeException($errorMessage);
}
* @param Installer $installer the Installer instance
*
* @return bool true if checks were successfully, otherwise false
+ * @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
private function runBasicChecks(Installer $installer)
{