-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?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\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 'typo3/cms-core'; | ||
} | ||
|
||
public function getFactories(): array | ||
{ | ||
return []; | ||
} | ||
|
||
public function getExtensions(): array | ||
{ | ||
return [ | ||
SetCollector::class => [ static::class, 'configureSetCollector' ], | ||
Check failure on line 41 in Classes/ServiceProvider.php GitHub Actions / Build PHP (^12, 8.2)
Check failure on line 41 in Classes/ServiceProvider.php GitHub Actions / Build PHP (^12, 8.3)
|
||
] + parent::getExtensions(); | ||
} | ||
|
||
public static function configureSetCollector(ContainerInterface $container, SetCollector $setCollector, ?string $path = null): SetCollector | ||
Check failure on line 45 in Classes/ServiceProvider.php GitHub Actions / Build PHP (^12, 8.2)
Check failure on line 45 in Classes/ServiceProvider.php GitHub Actions / Build PHP (^12, 8.2)
Check failure on line 45 in Classes/ServiceProvider.php GitHub Actions / Build PHP (^12, 8.3)
Check failure on line 45 in Classes/ServiceProvider.php GitHub Actions / Build PHP (^12, 8.3)
Check failure on line 45 in Classes/ServiceProvider.php GitHub Actions / Build PHP (^12, 8.1)
|
||
{ | ||
$setCollector = parent::configureSetCollector($container, $setCollector, $path); | ||
Check failure on line 47 in Classes/ServiceProvider.php GitHub Actions / Build PHP (^12, 8.2)
Check failure on line 47 in Classes/ServiceProvider.php GitHub Actions / Build PHP (^12, 8.3)
|
||
$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(...[ | ||
Check failure on line 69 in Classes/ServiceProvider.php GitHub Actions / Build PHP (^12, 8.2)
Check failure on line 69 in Classes/ServiceProvider.php GitHub Actions / Build PHP (^12, 8.3)
|
||
...$bpFullSet->toArray(), | ||
'dependencies' => [ | ||
...$bpFullSet->dependencies, | ||
...$optionalDependencies, | ||
], | ||
]) | ||
); | ||
return $setCollector; | ||
} | ||
} |
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' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import 'EXT:bootstrap_package/Configuration/TypoScript/Extension/Container/setup.typoscript' |
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 |
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 |
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/ | ||
} | ||
} | ||
} |
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 |
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/ | ||
} | ||
} | ||
} |