109 $this->defaultViewObjectName = \TYPO3\CMS\Fluid\View\TemplateView::class;
122 $hasDependencies =
false;
124 $dependencyTypes =
null;
127 'dependencies' => [],
130 $isAutomaticInstallationEnabled = (bool)GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(
'extensionmanager',
'automaticInstallation');
131 if (!$isAutomaticInstallationEnabled) {
133 $action =
'installExtensionWithoutSystemDependencyCheck';
135 $action =
'installFromTer';
137 $dependencyTypes = $this->managementService->getAndResolveDependencies($extension);
138 if (!empty($dependencyTypes)) {
139 $hasDependencies =
true;
140 $message =
'<p>' . $this->
translate(
'downloadExtension.dependencies.headline') .
'</p>';
141 foreach ($dependencyTypes as $dependencyType => $dependencies) {
143 foreach ($dependencies as $extensionKey => $dependency) {
144 if (!isset($configuration[
'value'][
'dependencies'][$dependencyType])) {
145 $configuration[
'value'][
'dependencies'][$dependencyType] = [];
147 $configuration[
'value'][
'dependencies'][$dependencyType][$extensionKey] = [
149 'categoryIndexFromStringOrNumber',
153 'downloadExtension.dependencies.extensionWithVersion',
155 $extensionKey, $dependency->getVersion()
160 'downloadExtension.dependencies.typeHeadline',
162 $this->
translate(
'downloadExtension.dependencyType.' . $dependencyType),
167 $title = $this->
translate(
'downloadExtension.dependencies.resolveAutomatically');
171 $title = $this->
translate(
'downloadExtension.dependencies.errorTitle');
172 $message = $e->getMessage();
176 $url = $this->uriBuilder->uriFor(
178 [
'extension' => $extension->getUid(),
'format' =>
'json'],
181 $this->view->setConfiguration($configuration);
182 $this->view->assign(
'value', [
183 'dependencies' => $dependencyTypes,
185 'message' => $message,
186 'hasErrors' => $hasErrors,
187 'hasDependencies' => $hasDependencies,
200 list($result, $errorMessages) = $this->
installFromTer($extension, $downloadPath);
201 $isAutomaticInstallationEnabled = (bool)GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(
'extensionmanager',
'automaticInstallation');
203 ->assign(
'result', $result)
204 ->assign(
'extension', $extension)
205 ->assign(
'installationTypeLanguageKey', $isAutomaticInstallationEnabled ?
'' :
'.downloadOnly')
206 ->assign(
'unresolvedDependencies', $errorMessages);
217 $this->managementService->setSkipDependencyCheck(
true);
218 $this->
forward(
'installFromTer',
null,
null, [
'extension' => $extension,
'downloadPath' =>
'Local']);
230 $this->
forward(
'distributions',
'List');
233 if ($errorMessages) {
234 foreach ($errorMessages as $extensionKey => $messages) {
235 foreach ($messages as $message) {
239 'distribution.error.headline',
243 \
TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR
257 'distribution.welcome.message',
259 [$extension->getExtensionKey()]
269 [
'extension' => $extension]
284 $extensionKey = $this->request->getArgument(
'extension');
285 $version = $this->request->getArgument(
'version');
286 $extension = $this->extensionRepository->findOneByExtensionKeyAndVersion($extensionKey, $version);
288 $extension = $this->extensionRepository->findHighestAvailableVersion($extensionKey);
292 if (in_array($extensionKey, $installedExtensions,
true)) {
294 $this->managementService->installExtension($extension);
296 $this->managementService->downloadMainExtension($extension);
299 $this->
translate(
'extensionList.updateFlashMessage.body', [$extensionKey]),
300 $this->
translate(
'extensionList.updateFlashMessage.title')
302 }
catch (\Exception $e) {
316 $extensionKey = $this->request->getArgument(
'extension');
317 $versionStart = $this->request->getArgument(
'integerVersionStart');
318 $versionStop = $this->request->getArgument(
'integerVersionStop');
319 $updateComments = [];
321 $updatableVersions = $this->extensionRepository->findByVersionRangeAndExtensionKeyOrderedByVersion(
327 $highestPossibleVersion =
false;
329 foreach ($updatableVersions as $updatableVersion) {
330 if ($highestPossibleVersion ===
false) {
331 $highestPossibleVersion = $updatableVersion->getVersion();
333 $updateComments[$updatableVersion->getVersion()] = $updatableVersion->getUpdateComment();
336 $this->view->assign(
'value', [
337 'updateComments' => $updateComments,
338 'url' => $this->uriBuilder->uriFor(
340 [
'extension' => $extensionKey,
'version' => $highestPossibleVersion]
353 protected function installFromTer(\
TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension, $downloadPath =
'Local')
358 $this->downloadUtility->setDownloadPath($downloadPath);
359 $isAutomaticInstallationEnabled = (bool)GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(
'extensionmanager',
'automaticInstallation');
360 $this->managementService->setAutomaticInstallationEnabled($isAutomaticInstallationEnabled);
361 if (($result = $this->managementService->installExtension($extension)) ===
false) {
362 $errorMessages = $this->managementService->getDependencyErrors();
364 }
catch (\
TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException $e) {
366 $extension->getExtensionKey() => [
368 'code' => $e->getCode(),
369 'message' => $e->getMessage(),
375 return [$result, $errorMessages];