feat(compat): Profile, Gates und Pods über den Kompatibilitätskern
Neu: Tier, Profile, Compatibility, CapabilityLocked, CapabilityGate, CompatibilityComponent, ProvidesCompatibility, DiviProfile sowie PodsFeature, PodsCompatibility und PodsIntegration. Das CapabilityGate sperrt gesperrte und unbekannte Fähigkeits-IDs (übernimmt die Sperre unbekannter IDs vom DiviFeatureGate) und delegiert nur Divi ausdrücklich. Pods-Schema, -Lesen, -Schreiben und -Feldrechte laufen über usable(PodsFeature::…); Schreiben verlangt FieldRead und FieldWrite, damit ein Rollback keine Werte verliert. lit-site-status meldet Pods über die CompatibilityComponent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
b511ef6348
commit
c85131603b
Generated
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace LIT\MCP\Integrations\Pods;
|
||||
|
||||
use LIT\MCP\Compatibility\Capability;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
// The installed PHPCompatibility sniffs predate enums (PHP 8.1) and read their methods as plain functions.
|
||||
// phpcs:disable PHPCompatibility.Variables.ForbiddenThisUseContexts.OutsideObjectContext
|
||||
|
||||
/** What the plugin can do with Pods, as far as a Pods update may break it separately. */
|
||||
enum PodsFeature: string implements Capability
|
||||
{
|
||||
case SchemaRead = 'pods-schema-read';
|
||||
case FieldRead = 'pods-field-read';
|
||||
case FieldWrite = 'pods-field-write';
|
||||
case FieldPermissions = 'pods-field-permissions';
|
||||
|
||||
public function id(): string
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::SchemaRead => 'Pods-Schema lesen',
|
||||
self::FieldRead => 'Pods-Felder lesen',
|
||||
self::FieldWrite => 'Pods-Felder schreiben',
|
||||
self::FieldPermissions => 'Pods-Feldrechte prüfen',
|
||||
};
|
||||
}
|
||||
|
||||
public function isWrite(): bool
|
||||
{
|
||||
return $this === self::FieldWrite;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user