}
// route: install/testrwrite
// $baseurl/install/testrwrite to test if rewrite in .htaccess is working
}
// route: install/testrwrite
// $baseurl/install/testrwrite to test if rewrite in .htaccess is working
}
self::$installer = new Core\Installer();
// get basic installation information and save them to the config cache
$configCache = $a->getConfigCache();
}
self::$installer = new Core\Installer();
// 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
// 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
self::checkSetting($configCache, $_POST, 'database', 'database', '');
// If we cannot connect to the database, return to the previous step
self::checkSetting($configCache, $_POST, 'database', 'database', '');
// If we cannot connect to the database, return to the previous step
self::checkSetting($configCache, $_POST, 'config', 'admin_email', '');
// If we cannot connect to the database, return to the Database config wizard
self::checkSetting($configCache, $_POST, 'config', 'admin_email', '');
// If we cannot connect to the database, return to the Database config wizard
switch (self::$currentWizardStep) {
case self::SYSTEM_CHECK:
$php_path = $configCache->get('config', 'php_path');
switch (self::$currentWizardStep) {
case self::SYSTEM_CHECK:
$php_path = $configCache->get('config', 'php_path');
$output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title,
$output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title,
- '$see_install' => L10n::t('Please see the file "INSTALL.txt".'),
- '$next' => L10n::t('Next'),
- '$reload' => L10n::t('Check again'),
+ '$see_install' => DI::l10n()->t('Please see the file "INSTALL.txt".'),
+ '$next' => DI::l10n()->t('Next'),
+ '$reload' => DI::l10n()->t('Check again'),
- BaseUrl::SSL_POLICY_NONE => L10n::t("No SSL policy, links will track page SSL state"),
- BaseUrl::SSL_POLICY_FULL => L10n::t("Force all links to use SSL"),
- BaseUrl::SSL_POLICY_SELFSIGN => L10n::t("Self-signed certificate, use SSL for local links only \x28discouraged\x29")
+ App\BaseURL::SSL_POLICY_NONE => DI::l10n()->t("No SSL policy, links will track page SSL state"),
+ App\BaseURL::SSL_POLICY_FULL => DI::l10n()->t("Force all links to use SSL"),
+ App\BaseURL::SSL_POLICY_SELFSIGN => DI::l10n()->t("Self-signed certificate, use SSL for local links only \x28discouraged\x29")
$output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title,
$output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title,
- L10n::t('Overwrite this field in case the determinated hostname isn\'t right, otherweise leave it as is.'),
+ DI::l10n()->t('Overwrite this field in case the determinated hostname isn\'t right, otherweise leave it as is.'),
- L10n::t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."),
+ DI::l10n()->t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."),
- L10n::t('Overwrite this field in case the sub path determination isn\'t right, otherwise leave it as is. Leaving this field blank means the installation is at the base URL without sub path.'),
+ DI::l10n()->t('Overwrite this field in case the sub path determination isn\'t right, otherwise leave it as is. Leaving this field blank means the installation is at the base URL without sub path.'),
$output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title,
$output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title,
- '$pass' => L10n::t('Database connection'),
- '$info_01' => L10n::t('In order to install Friendica we need to know how to connect to your database.'),
- '$info_02' => L10n::t('Please contact your hosting provider or site administrator if you have questions about these settings.'),
- '$info_03' => L10n::t('The database you specify below should already exist. If it does not, please create it before continuing.'),
+ '$pass' => DI::l10n()->t('Database connection'),
+ '$info_01' => DI::l10n()->t('In order to install Friendica we need to know how to connect to your database.'),
+ '$info_02' => DI::l10n()->t('Please contact your hosting provider or site administrator if you have questions about these settings.'),
+ '$info_03' => DI::l10n()->t('The database you specify below should already exist. If it does not, please create it before continuing.'),
'checks' => self::$installer->getChecks(),
'$hostname' => $configCache->get('config', 'hostname'),
'$ssl_policy' => $configCache->get('system', 'ssl_policy'),
'$basepath' => $configCache->get('system', 'basepath'),
'$urlpath' => $configCache->get('system', 'urlpath'),
'$dbhost' => ['database-hostname',
'checks' => self::$installer->getChecks(),
'$hostname' => $configCache->get('config', 'hostname'),
'$ssl_policy' => $configCache->get('system', 'ssl_policy'),
'$basepath' => $configCache->get('system', 'basepath'),
'$urlpath' => $configCache->get('system', 'urlpath'),
'$dbhost' => ['database-hostname',
- '$dbuser ' => ['database-username',
- L10n::t('Database Login Name'),
+ '$dbuser' => ['database-username',
+ DI::l10n()->t('Database Login Name'),
$configCache->get('database', 'username'),
'',
'required',
'autofocus'],
'$dbpass' => ['database-password',
$configCache->get('database', 'username'),
'',
'required',
'autofocus'],
'$dbpass' => ['database-password',
- '$lbl_10' => L10n::t('Please select a default timezone for your website'),
- '$baseurl' => $a->getBaseURL(),
+ '$lbl_10' => DI::l10n()->t('Please select a default timezone for your website'),
$output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title,
'$checks' => self::$installer->getChecks(),
$output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title,
'$checks' => self::$installer->getChecks(),
'$hostname' => $configCache->get('config', 'hostname'),
'$ssl_policy' => $configCache->get('system', 'ssl_policy'),
'$basepath' => $configCache->get('system', 'basepath'),
'$hostname' => $configCache->get('config', 'hostname'),
'$ssl_policy' => $configCache->get('system', 'ssl_policy'),
'$basepath' => $configCache->get('system', 'basepath'),
'$dbpass' => $configCache->get('database', 'password'),
'$dbdata' => $configCache->get('database', 'database'),
'$adminmail' => ['config-admin_email',
'$dbpass' => $configCache->get('database', 'password'),
'$dbdata' => $configCache->get('database', 'database'),
'$adminmail' => ['config-admin_email',
'required', 'autofocus', 'email'],
'$timezone' => Temporal::getTimezoneField('system-default_timezone',
'required', 'autofocus', 'email'],
'$timezone' => Temporal::getTimezoneField('system-default_timezone',
$configCache->get('system', 'default_timezone'),
''),
'$language' => ['system-language',
$configCache->get('system', 'default_timezone'),
''),
'$language' => ['system-language',
- $txt = '<p style="font-size: 130%;">';
- $txt .= L10n::t('Your Friendica site database has been installed.') . EOL;
+ $txt = '<p style="font-size: 130%;">';
+ $txt .= DI::l10n()->t('Your Friendica site database has been installed.') . EOL;
$output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title,
'$checks' => self::$installer->getChecks(),
$output .= Renderer::replaceMacros($tpl, [
'$title' => $install_title,
'$checks' => self::$installer->getChecks(),
- '$pass' => L10n::t('Installation finished'),
- '$text' => $db_return_text . self::whatNext($a),
+ '$pass' => DI::l10n()->t('Installation finished'),
+ '$text' => $db_return_text . self::whatNext(),
* @return string The text for the next steps
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
* @return string The text for the next steps
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- L10n::t('<h1>What next</h1>')
- . "<p>".L10n::t('IMPORTANT: You will need to [manually] setup a scheduled task for the worker.')
- . L10n::t('Please see the file "INSTALL.txt".')
+ DI::l10n()->t('<h1>What next</h1>')
+ . "<p>" . DI::l10n()->t('IMPORTANT: You will need to [manually] setup a scheduled task for the worker.')
+ . DI::l10n()->t('Please see the file "INSTALL.txt".')
- . L10n::t('Go to your new Friendica node <a href="%s/register">registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.', $baseurl)
+ . DI::l10n()->t('Go to your new Friendica node <a href="%s/register">registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.', $baseurl)
- * @param IConfigCache $configCache The current config cache
- * @param array $post The $_POST data
- * @param string $cat The category of the setting
- * @param string $key The key of the setting
- * @param null|string $default The default value
+ * @param ConfigCache $configCache The current config cache
+ * @param array $post The $_POST data
+ * @param string $cat The category of the setting
+ * @param string $key The key of the setting
+ * @param null|string $default The default value
- private static function checkSetting(IConfigCache $configCache, array $post, $cat, $key, $default = null)
+ private static function checkSetting(ConfigCache $configCache, array $post, $cat, $key, $default = null)
- trim(defaults($post, sprintf('%s-%s', $cat, $key),
- (!isset($default) ? $configCache->get($cat, $key) : $default))
+ trim(($post[sprintf('%s-%s', $cat, $key)] ?? '') ?:
+ ($default ?? $configCache->get($cat, $key))