-
Notifications
You must be signed in to change notification settings - Fork 653
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Dispatch event after extension install with site config
An extension can provide site configuration to be imported into the TYPO3 instance by providing a file in Initialisation/Site. After the processing has been done, an event is dispatched now. Resolves: #93687 Releases: master, 10.4 Change-Id: Iff932d3855ebfd6532f3a011d3a511015f1226db Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68312 Tested-by: TYPO3com <noreply@typo3.com> Tested-by: core-ci <typo3@b13.com> Tested-by: Richard Haeser <richard@richardhaeser.com> Reviewed-by: Richard Haeser <richard@richardhaeser.com>
- Loading branch information
Showing
2 changed files
with
76 additions
and
6 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
typo3/sysext/extensionmanager/Classes/Event/AfterExtensionSiteFilesHaveBeenImportedEvent.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace TYPO3\CMS\Extensionmanager\Event; | ||
|
||
/** | ||
* Event that is triggered after a package has imported its site configurations (from Initialisation/Site) | ||
*/ | ||
final class AfterExtensionSiteFilesHaveBeenImportedEvent | ||
{ | ||
/** | ||
* @var string | ||
* | ||
* extension that imported the site configuration | ||
*/ | ||
private $packageKey; | ||
|
||
/** | ||
* @var array list of site identifiers that were imported | ||
* | ||
* use as | ||
* foreach ($siteIdentifierList as $siteIdentifier) { | ||
* $configuration = $siteConfiguration->load($siteIdentifier); | ||
* // do things | ||
* } | ||
*/ | ||
private $siteIdentifierList; | ||
|
||
public function __construct(string $packageKey, array $newSiteIdentifierList) | ||
{ | ||
$this->packageKey = $packageKey; | ||
$this->siteIdentifierList = $newSiteIdentifierList; | ||
} | ||
|
||
public function getPackageKey(): string | ||
{ | ||
return $this->packageKey; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getSiteIdentifierList(): array | ||
{ | ||
return $this->siteIdentifierList; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters