namespace Shaarli\Front\Controller\Visitor;
use Shaarli\ApplicationUtils;
-use Shaarli\Bookmark\BookmarkFilter;
use Shaarli\Container\ShaarliContainer;
use Shaarli\Front\Exception\AlreadyInstalledException;
use Shaarli\Front\Exception\ResourcePermissionException;
$this->assignView('cities', $cities);
$this->assignView('languages', Languages::getAvailableLanguages());
+ $phpEol = new \DateTimeImmutable(ApplicationUtils::getPhpEol(PHP_VERSION));
+
+ $this->assignView('php_version', PHP_VERSION);
+ $this->assignView('php_eol', format_date($phpEol, false));
+ $this->assignView('php_has_reached_eol', $phpEol < new \DateTimeImmutable());
+ $this->assignView('php_extensions', ApplicationUtils::getPhpExtensionsRequirement());
+ $this->assignView('permissions', ApplicationUtils::checkResourcePermissions($this->container->conf));
+
+ $this->assignView('pagetitle', t('Install Shaarli'));
+
return $response->write($this->render('install'));
}
$this->container->conf->get('credentials.salt')
)
);
- $this->container->conf->set('general.header_link', $this->container->basePath);
+ $this->container->conf->set('general.header_link', $this->container->basePath . '/');
try {
// Everything is ok, let's create config file.
return $response->write($this->render('error'));
}
- if ($this->container->bookmarkService->count(BookmarkFilter::$ALL) === 0) {
- $this->container->bookmarkService->initialize();
- }
-
$this->container->sessionManager->setSessionParameter(
SessionManager::KEY_SUCCESS_MESSAGES,
[t('Shaarli is now configured. Please login and start shaaring your bookmarks!')]
);
- return $this->redirect($response, '/');
+ return $this->redirect($response, '/login');
}
protected function checkPermissions(): bool
{
// Ensure Shaarli has proper access to its resources
- $errors = ApplicationUtils::checkResourcePermissions($this->container->conf);
+ $errors = ApplicationUtils::checkResourcePermissions($this->container->conf, true);
if (empty($errors)) {
return true;
}