Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
64
tests/debug/debug-attribute-parsing.php
Normal file
64
tests/debug/debug-attribute-parsing.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
echo "=== Testing Attribute Parsing ===" . PHP_EOL;
|
||||
|
||||
// Test the specific MCP Server Command file
|
||||
$mcpServerPath = __DIR__ . '/../../src/Framework/Mcp/Console/McpServerCommand.php';
|
||||
|
||||
if (! file_exists($mcpServerPath)) {
|
||||
echo "❌ MCP Server Command file not found!" . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
echo "✅ Found MCP Server Command file" . PHP_EOL;
|
||||
|
||||
// Read and parse the file content
|
||||
$content = file_get_contents($mcpServerPath);
|
||||
|
||||
// Check for ConsoleCommand attribute
|
||||
if (strpos($content, '#[ConsoleCommand') !== false) {
|
||||
echo "✅ ConsoleCommand attribute found in file" . PHP_EOL;
|
||||
} else {
|
||||
echo "❌ ConsoleCommand attribute NOT found in file" . PHP_EOL;
|
||||
}
|
||||
|
||||
// Use reflection to check if the attribute is actually readable
|
||||
require_once $mcpServerPath;
|
||||
|
||||
try {
|
||||
$reflection = new ReflectionClass('App\\Framework\\Mcp\\Console\\McpServerCommand');
|
||||
echo "✅ Class can be reflected: " . $reflection->getName() . PHP_EOL;
|
||||
|
||||
$methods = $reflection->getMethods(ReflectionMethod::IS_PUBLIC);
|
||||
echo "Found " . count($methods) . " public methods:" . PHP_EOL;
|
||||
|
||||
foreach ($methods as $method) {
|
||||
echo " Method: " . $method->getName() . PHP_EOL;
|
||||
|
||||
$attributes = $method->getAttributes();
|
||||
echo " Attributes: " . count($attributes) . PHP_EOL;
|
||||
|
||||
foreach ($attributes as $attribute) {
|
||||
echo " - " . $attribute->getName() . PHP_EOL;
|
||||
|
||||
if ($attribute->getName() === 'App\\Framework\\Console\\ConsoleCommand') {
|
||||
echo " ✅ Found ConsoleCommand attribute!" . PHP_EOL;
|
||||
|
||||
try {
|
||||
$instance = $attribute->newInstance();
|
||||
echo " Name: " . $instance->name . PHP_EOL;
|
||||
echo " Description: " . $instance->description . PHP_EOL;
|
||||
} catch (Exception $e) {
|
||||
echo " ❌ Error creating instance: " . $e->getMessage() . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo "❌ Error reflecting class: " . $e->getMessage() . PHP_EOL;
|
||||
}
|
||||
Reference in New Issue
Block a user