Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Supported Stacks for now:
- Craft CMS
- Drupal
- Grav CMS
- Kirby CMS
- Laravel
- Leaf PHP
- Lunar
Expand Down
1 change: 1 addition & 0 deletions lib/Enum/StackType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ enum StackType: string
case CRAFT_CMS = 'craft-cms';
case DRUPAL = 'drupal';
case GRAV_CMS = 'grav-cms';
case KIRBY_CMS = 'kirby-cms';
case LARAVEL = 'laravel';
case LEAF_PHP = 'leaf';
case LUNAR = 'lunar';
Expand Down
2 changes: 2 additions & 0 deletions lib/Factory/HasStackDetectors.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use fortrabbit\StackDetector\StackDetector\SymfonyDetector;
use fortrabbit\StackDetector\StackDetector\WordpressDetector;
use fortrabbit\StackDetector\DirectoryCrawler\AdapterInterface;
use fortrabbit\StackDetector\StackDetector\KirbyCMSDetector;

trait HasStackDetectors
{
Expand All @@ -47,6 +48,7 @@ private function getStackDetectors(
new CakePhpDetector($packageVersionProvider),
new CodeigniterDetector($packageVersionProvider),
new DrupalDetector($packageVersionProvider),
new KirbyCMSDetector($packageVersionProvider),
new GravCMSDetector($packageVersionProvider),
new LeafDetector($packageVersionProvider),
new LunarDetector($packageVersionProvider),
Expand Down
21 changes: 21 additions & 0 deletions lib/StackDetector/KirbyCMSDetector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

namespace fortrabbit\StackDetector\StackDetector;

use fortrabbit\StackDetector\Enum\StackType;
use fortrabbit\StackDetector\StackDetectorInterface;

class KirbyCMSDetector extends BaseComposerTypeDetector implements StackDetectorInterface
{
protected function packagesToSearch(): array
{
return ['getkirby/cms'];
}

protected function detectedStackType(): StackType
{
return StackType::KIRBY_CMS;
}
}
2 changes: 2 additions & 0 deletions tests/Unit/DetectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ public static function packagesDataProvider(): array

'Grav CMS 2' => ['grav_cms/2', '2', StackType::GRAV_CMS],

'Kirby CMS 5' => ['kirby_cms/5', '5', StackType::KIRBY_CMS],

'Leaf 3' => ['leaf/3', '3', StackType::LEAF_PHP],

'Lunar 1' => ['lunar/1', '1', StackType::LUNAR],
Expand Down
19 changes: 19 additions & 0 deletions tests/fixtures/php-stack/kirby_cms/5/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "test/project",
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"getkirby/cms": "^5.0"
},
"config": {
"allow-plugins": {
"getkirby/composer-installer": true
},
"optimize-autoloader": true
},
"scripts": {
"start": [
"Composer\\Config::disableProcessTimeout",
"@php -S localhost:8000 kirby/router.php"
]
}
}
Loading