← ClaudeAtlas

symfony-opcualisted

Symfony 7.4+ / 8.x bundle for OPC UA. Autowires `OpcuaManager` and `OpcUaClientInterface` via DI, exposes YAML-based named connections, ships an `opcua:session` console command for the session-manager daemon, and dispatches all 56 OPC UA events through Symfony's `EventDispatcherInterface`. Use this skill whenever the user is working with OPC UA from a Symfony application — controllers, Messenger handlers, console commands, scheduled tasks, EasyAdmin / API Platform endpoints, or Pest tests.
php-opcua/ai-skills · ★ 0 · AI & Automation · score 68
Install: claude install-skill php-opcua/ai-skills
# symfony-opcua A `symfony-bundle` over `php-opcua/opcua-client`. Three things to remember: 1. **No Facade, no static helpers.** Type-hint `OpcuaManager` or `OpcUaClientInterface` in your constructor. Autowiring resolves them. 2. **`OpcuaManager::connect($name)` returns the underlying `OpcUaClientInterface` directly.** Anything `opcua-client` can do, the client returned can do. 3. **Bundle uses `AbstractBundle` + `DefinitionConfigurator` + `loadExtension()`** (modern Symfony 6.1+ style). No XML/YAML service definitions to ship — wiring is code-driven. ## What this package is for | You want to | Use | |---|---| | Read / write OPC UA nodes from a controller, service, command | Inject `OpcUaClientInterface` (default conn) or `OpcuaManager` | | Talk to multiple OPC UA servers | Named connections in YAML, `$opcuaManager->connection('plc-1')` | | Connect to a runtime-discovered endpoint | `$opcuaManager->connectTo($url, $configOverrides, as: 'cache-key')` | | Avoid one new TCP connection per HTTP request | Run `php bin/console opcua:session` as a supervised daemon | | React to data changes, alarms, etc. via PSR-14 → Symfony events | Configure `auto_publish: true` + per-connection `auto_connect: true`, register `#[AsEventListener]` | | Test code that touches OPC UA without a server | `MockClient` + `self::getContainer()->set(OpcUaClientInterface::class, $mock)` | | Stream notifications to API Platform / EasyAdmin / Mercure | Standard Symfony event listeners on `DataChangeReceive