Changelog
[4.3.0] - 2026-05-15
Added
- Per-connection
log_channelconfig key — Monolog channel name resolved lazily at runtime, no Monolog reference needed in config files. OpcuaManager::setLogger(LoggerInterface)runtime override (best-effort propagation to existing connections).OpcuaManager::useConsoleLogger(OutputInterface, …, ?string $dateFormat = 'Y-m-d H:i:s.v')— SymfonyConsoleLoggerwrapped with millisecond timestamp by default; passdateFormat: nullto disable.OpcuaManager::getLogger().Logging\TimestampedLogger— generic PSR-3 decorator that prepends a formatted timestamp.Logging\LoggerResolverFactory+ bundle-sideServiceLocatorwiring that maps configured channels tomonolog.logger.<channel>references.
Changed
OpcuaManager::__constructgained an optional?\Closure $loggerResolverparameter (5th, defaultnull, BC-safe).- Logger resolution priority: runtime override → config
'logger'→ config'log_channel'→ default logger. - Bumped
php-opcua/opcua-client^4.2.0→^4.3.0andphp-opcua/opcua-session-manager^4.2.0→^4.3.1. Notable downstream impact:NodeManagementModuleis back in the default module list —addNodes()/deleteNodes()/addReferences()/deleteReferences()reachable through the manager. Servers without the service set raiseServiceUnsupportedExceptionon first call (still a subclass ofServiceException, existing handlers keep matching).- Top-level
ServiceFaultnow decodes toServiceExceptioninstead of the misleadingEncodingException: Buffer underflow. - Wire-format compliance fixes:
RequestHeader.timestampis a validUtcTime, anonymouspolicyIddiscovered for all security modes, NodeManagement TypeIds reference DefaultBinary encoding, ECC sequence numbers per OPC UA 1.05.4. Servers stricter than UA-.NETStandard (open62541 etc.) are now reachable. - Cache codec breaking change — persistent caches must be flushed on upgrade.
unserialize()removed from every cache code path;WireCacheCodec(JSON gated by allowlist) is the new default. Pre-v4.3 entries are silently discarded on first access. NewClientBuilder::setCacheCodec()is available if you need to override. - Daemon:
--versionflag,umask(0077)around bind closes the socket-permission race, NDJSON 64 KiB per-frame cap, IPv4-mapped IPv6 loopback handled,usernameno longer leaked vialist, Windows path / URL redaction in error messages, conservative PID-check fallback. - Daemon: Unix-socket path length is now validated before bind — long paths get a clear
DaemonExceptioninstead of a confusingchmod(): No such file or directoryafter silent kernel truncation.
Tests
- +22 unit tests.
[4.2.0] - 2026-04-17
Changed
- Bumped
php-opcua/opcua-clientfrom^4.1.1to^4.2.0andphp-opcua/opcua-session-managerfrom^4.1to^4.2.0. Picks up the Kernel + ServiceModule architecture, the Wire-serialization pipeline, the describe/invoke IPC commands that make third-party modules reachable throughManagedClient::__call(), and the cross-platform IPC transport (Unix socket on Linux/macOS, TCP loopback on Windows).
Added
-
Cross-platform session manager out of the box.
php_opcua_symfony_opcua.session_manager.socket_pathnow accepts:unix://<path>(explicit Unix-domain socket)tcp://127.0.0.1:<port>(loopback-only — non-loopback hosts are refused byTcpLoopbackTransporton the client and bySessionManagerDaemonon the daemon)- scheme-less path (interpreted as
unix://<path>, backwards-compatible with pre-v4.2.0 configs)
OpcuaManager::isSessionManagerRunning()andOpcuaManager::shouldUseSessionManager()now inspect the endpoint URI viaTransportFactory::toUnixPath()— for Unix endpoints they keep the historicalfile_exists()check; TCP endpoints can't be filesystem-probed, so presence is assumed (a missing daemon surfaces as a clearDaemonExceptionon the first IPC call). -
php bin/console opcua:sessionreflects the endpoint kind. The startup table shows "Endpoint" instead of "Socket", and the "Socket Mode" row is only printed for Unix-socket endpoints. The parent-directorymkdiris skipped for TCP endpoints.
Tests / CI
- CI workflow aligned with
opcua-client/opcua-session-manager:unitjob cross-OS onubuntu-latest/macos-latest/windows-latest× PHP 8.2–8.5 × Symfony 7.3 / 7.4 / 8.0 (with the existing exclusion matrix);integrationjob stays Ubuntu-only (Docker-hosted OPC UA servers) withneeds: unitgating.[DOC]commits skip CI.codecov/codecov-actionbumped fromv5tov6. - Unit tests (
tests/Unit/) are fully cross-OS. Integration tests (tests/Integration/) remain Docker-dependent and run only in the integration job. - Full suite: 244 passing, 0 failing on Linux.
[4.1.0] - 2026-04-14
Added
- Initial release of
php-opcua/symfony-opcua. Symfony bundle equivalent ofphp-opcua/laravel-opcua, providing full OPC UA integration for Symfony 6.4+ and 7.x applications.
Bundle
PhpOpcuaSymfonyOpcuaBundle— modernAbstractBundlewith semantic YAML configuration via TreeBuilder and service registration vialoadExtension().OpcuaManager— manages named connections, auto-detects session manager daemon, configures both direct (ClientBuilder) and managed (ManagedClient) modes. Autowirable as a service.OpcUaClientInterfaceautowiring — factory-based service definition that returns the default connection, injectable anywhere via constructor injection.opcuaalias — convenience alias forOpcuaManager.- PSR-16 cache adapter — automatically wraps a Symfony PSR-6 cache pool (
cache.appby default) intoPsr16Cachefor the OPC UA client. - PSR-3 logging — Monolog logger injected automatically. Configurable via
log_channelto use a specific Monolog channel (monolog.logger.<channel>). - PSR-14 events — Symfony's
EventDispatcherInterfaceinjected automatically when available. All 47 OPC UA events dispatched through Symfony's event system.
Console Command
opcua:session— Symfony console command to start the session manager daemon. Supports--timeout,--cleanup-interval,--max-sessions,--socket-modeoptions.- Auto-publish support — when
auto_publishis enabled, the daemon automatically callspublish()for sessions with active subscriptions and dispatches PSR-14 events. - Auto-connect support — connections with
auto_connect: trueare established on daemon startup with declarative subscription configuration.
Configuration
- Full YAML-based semantic configuration with TreeBuilder validation:
default— default connection namesession_manager— daemon settings (enabled, socket_path, timeout, cleanup_interval, auth_token, max_sessions, socket_mode, allowed_cert_dirs, log_channel, cache_pool, auto_publish)connections— named connections with endpoint, security (10 policies including ECC), authentication, timeouts, trust store, write auto-detection, metadata cache, auto-connect, and declarative subscriptions
- Reference configuration file at
config/opcua.yaml
Security
- All 10 security policies supported:
None,Basic128Rsa15,Basic256,Basic256Sha256,Aes128Sha256RsaOaep,Aes256Sha256RsaPss,ECC_nistP256,ECC_nistP384,ECC_brainpoolP256r1,ECC_brainpoolP384r1. - 3 security modes:
None,Sign,SignAndEncrypt. - 3 authentication methods: anonymous, username/password, X.509 certificate.
- Trust store with
FileTrustStore, configurableTrustPolicy(fingerprint,fingerprint+expiry,full), auto-accept/TOFU mode. - Auto-generated client certificates when
client_certificate/client_keyare omitted.
Features (inherited from opcua-client v4.1.1)
- All OPC UA operations — browse, read, write, call, subscriptions, events, history, path resolution, type discovery.
- String NodeIds —
'i=2259','ns=2;s=MyNode'everywhere. - Fluent Builder API —
readMulti(),writeMulti(),createMonitoredItems(),translateBrowsePaths(). - Write auto-detection — omit the type parameter on
write(). - Read metadata cache — cached node metadata with
refreshparameter. - Type discovery —
discoverDataTypes()for server-defined structured types. - Subscription management —
createMonitoredItems(),modifyMonitoredItems(),setTriggering(),transferSubscriptions(),republish(). - Certificate trust management —
trustCertificate(),untrustCertificate(). - Auto-batching —
readMulti/writeMultitransparently split when exceeding server limits. - Recursive browse —
browseAll(),browseRecursive()with depth control. - Path resolution —
resolveNodeId('/Objects/Server/ServerStatus'). - MockClient — test without a server.
Testing
- 144 unit tests with Pest PHP and Mockery.
OpcuaManagerTest— 97 tests covering connection management, configuration, security resolution.BundleTest— 12 tests covering TreeBuilder, service registration, alias, factory definitions.ConfigurationTest— 10 tests covering defaults, custom values, subscriptions, validation.SessionCommandTest— 25 tests covering config passthrough, CLI overrides, auto-publish, auto-connect, daemon config mapping.
Documentation
- 10 documentation files (
doc/01-introduction.mdthroughdoc/10-auto-publish.md) covering introduction, installation, usage, connections, session manager, logging & caching, security, testing, examples, and auto-publish. - Full README with feature table, code examples, ecosystem overview, and AI-Ready section.
Dependencies
php-opcua/opcua-client^4.1.1php-opcua/opcua-session-manager^4.1symfony/framework-bundle^6.4|^7.0symfony/console^6.4|^7.0symfony/dependency-injection^6.4|^7.0symfony/config^6.4|^7.0symfony/cache^6.4|^7.0