Requirement, Call, ConstantRequirement, Mirror, Problem, FeatureStatus, CompatibilityMatrix, Manifest, ManifestCheck sowie Fingerprints und LineDiff liegen jetzt im divi-freien Kern. Neu: GlobalRequirement, CompatibilityMatrix::fromProblems(), ManifestCheck-Option signatures, DiviManifestCheck::create() und DiviAreas. Divi-Verhalten unverändert. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
962 B
PHP
36 lines
962 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace LIT\MCP\Integrations\Divi\Release;
|
|
|
|
use LIT\MCP\Compatibility\ManifestCheck;
|
|
use LIT\MCP\Compatibility\Mirror;
|
|
use LIT\MCP\Compatibility\SourceFingerprint;
|
|
use LIT\MCP\Integrations\Divi\Schema\DiviModules;
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
/** The ManifestCheck of Divi: its adapter manifests, signature references, theme sources and block registry. */
|
|
final class DiviManifestCheck
|
|
{
|
|
public static function create(): ManifestCheck
|
|
{
|
|
return new ManifestCheck(
|
|
DiviAdapters::manifests(),
|
|
DiviReference::expected(),
|
|
self::installed(...),
|
|
DiviModules::knowsBlock(...)
|
|
);
|
|
}
|
|
|
|
private static function installed(Mirror $mirror): ?string
|
|
{
|
|
$dir = DiviEnvironment::themeDir();
|
|
|
|
return $dir === null
|
|
? null
|
|
: SourceFingerprint::of($dir . '/' . $mirror->file, $mirror->function, $mirror->class)->hash;
|
|
}
|
|
}
|