-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
184 additions
and
9 deletions.
There are no files selected for viewing
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
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,26 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^Call to an undefined static method TYPO3\\\\CMS\\\\Core\\\\Package\\\\AbstractServiceProvider\\:\\:configureSetCollector\\(\\)\\.$#" | ||
count: 1 | ||
path: ../Classes/ServiceProvider.php | ||
|
||
- | ||
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetCollector not found\\.$#" | ||
count: 1 | ||
path: ../Classes/ServiceProvider.php | ||
|
||
- | ||
message: "#^Instantiated class TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetDefinition not found\\.$#" | ||
count: 1 | ||
path: ../Classes/ServiceProvider.php | ||
|
||
- | ||
message: "#^Method BK2K\\\\BootstrapPackage\\\\ServiceProvider\\:\\:configureSetCollector\\(\\) has invalid return type TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetCollector\\.$#" | ||
count: 1 | ||
path: ../Classes/ServiceProvider.php | ||
|
||
- | ||
message: "#^Parameter \\$setCollector of method BK2K\\\\BootstrapPackage\\\\ServiceProvider\\:\\:configureSetCollector\\(\\) has invalid type TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetCollector\\.$#" | ||
count: 1 | ||
path: ../Classes/ServiceProvider.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,3 @@ | ||
includes: | ||
- %currentWorkingDirectory%/Build/phpstan.neon | ||
- %currentWorkingDirectory%/Build/phpstan-baseline-v12.neon |
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,3 @@ | ||
includes: | ||
- %currentWorkingDirectory%/Build/phpstan.neon | ||
- %currentWorkingDirectory%/Build/phpstan-baseline-v13.neon |
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
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,84 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the package bk2k/bootstrap-package. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace BK2K\BootstrapPackage; | ||
|
||
use Psr\Container\ContainerInterface; | ||
use TYPO3\CMS\Core\Information\Typo3Version; | ||
use TYPO3\CMS\Core\Package\AbstractServiceProvider; | ||
use TYPO3\CMS\Core\Package\PackageManager; | ||
use TYPO3\CMS\Core\Site\Set\SetCollector; | ||
use TYPO3\CMS\Core\Site\Set\SetDefinition; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
class ServiceProvider extends AbstractServiceProvider | ||
{ | ||
protected static function getPackagePath(): string | ||
{ | ||
return __DIR__ . '/../'; | ||
} | ||
|
||
protected static function getPackageName(): string | ||
{ | ||
return 'bk2k/bootstrap-package'; | ||
} | ||
|
||
public function getFactories(): array | ||
{ | ||
return []; | ||
} | ||
|
||
public function getExtensions(): array | ||
{ | ||
if ((new Typo3Version)->getMajorVersion() <= 12) { | ||
return parent::getExtensions(); | ||
} | ||
|
||
return [ | ||
SetCollector::class => [ static::class, 'configureSetCollector' ], | ||
] + parent::getExtensions(); | ||
} | ||
|
||
public static function configureSetCollector(ContainerInterface $container, SetCollector $setCollector, ?string $path = null): SetCollector | ||
{ | ||
$setCollector = parent::configureSetCollector($container, $setCollector, $path); | ||
$availableSets = $setCollector->getSetDefinitions(); | ||
$bpFullSet = $availableSets['bootstrap-package/full'] ?? null; | ||
if ($bpFullSet === null) { | ||
return $setCollector; | ||
} | ||
|
||
$optionalDependencies = []; | ||
if (isset($availableSets['typo3/form'])) { | ||
$optionalDependencies[] = 'bootstrap-package/ext-form'; | ||
} | ||
if (isset($availableSets['typo3/seo-sitemap'])) { | ||
$optionalDependencies[] = 'bootstrap-package/ext-seo'; | ||
} | ||
if (isset($availableSets['typo3/indexed-search'])) { | ||
$optionalDependencies[] = 'bootstrap-package/ext-indexed-search'; | ||
} | ||
if ($container->get(PackageManager::class)->isPackageActive('container')) { | ||
$optionalDependencies[] = 'bootstrap-package/ext-container'; | ||
} | ||
|
||
$setCollector->add( | ||
new SetDefinition(...[ | ||
...$bpFullSet->toArray(), | ||
'dependencies' => [ | ||
...$bpFullSet->dependencies, | ||
...$optionalDependencies, | ||
], | ||
]) | ||
); | ||
return $setCollector; | ||
} | ||
} |
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,2 @@ | ||
name: bootstrap-package/ext-container | ||
label: 'Bootstrap Package: EXT:container integration' |
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 @@ | ||
@import 'EXT:bootstrap_package/Configuration/TypoScript/Extension/Container/setup.typoscript' |
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,4 @@ | ||
name: bootstrap-package/ext-form | ||
label: 'Bootstrap Package: EXT:form integration' | ||
dependencies: | ||
- typo3/form |
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,4 @@ | ||
name: bootstrap-package/ext-indexed-search | ||
label: 'Bootstrap Package: EXT:indexed_search integration' | ||
dependencies: | ||
- typo3/indexed-search |
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,16 @@ | ||
plugin.tx_indexedsearch { | ||
view { | ||
templateRootPaths { | ||
20 = EXT:bootstrap_package/Resources/Private/Templates/IndexedSearch/ | ||
21 = {$plugin.bootstrap_package.view.templateRootPath}IndexedSearch/ | ||
} | ||
partialRootPaths { | ||
20 = EXT:bootstrap_package/Resources/Private/Partials/IndexedSearch/ | ||
21 = {$plugin.bootstrap_package.view.partialRootPath}IndexedSearch/ | ||
} | ||
layoutRootPaths { | ||
20 = EXT:bootstrap_package/Resources/Private/Layouts/IndexedSearch/ | ||
21 = {$plugin.bootstrap_package.view.layoutRootPath}IndexedSearch/ | ||
} | ||
} | ||
} |
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,4 @@ | ||
name: bootstrap-package/ext-seo | ||
label: 'Bootstrap Package: EXT:seo integration' | ||
dependencies: | ||
- typo3/seo-sitemap |
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,16 @@ | ||
plugin.tx_seo { | ||
view { | ||
templateRootPaths { | ||
20 = EXT:bootstrap_package/Resources/Private/Templates/Seo/ | ||
21 = {$plugin.bootstrap_package.view.templateRootPath}Seo/ | ||
} | ||
partialRootPaths { | ||
20 = EXT:bootstrap_package/Resources/Private/Partials/Seo/ | ||
21 = {$plugin.bootstrap_package.view.partialRootPath}Seo/ | ||
} | ||
layoutRootPaths { | ||
20 = EXT:bootstrap_package/Resources/Private/Layouts/Seo/ | ||
21 = {$plugin.bootstrap_package.view.layoutRootPath}Seo/ | ||
} | ||
} | ||
} |
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
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
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