Installation
Getting Started
Introduction Overview InstallationUsage
Daemon Managed-client Ipc-protocol Type-serializationReference
Testing ExamplesInstallation
Requirements
- PHP >= 8.2
ext-opensslext-pcntl(recommended — enables graceful SIGTERM/SIGINT shutdown)- Composer
Composer
composer require php-opcua/opcua-session-managerThis pulls in:
php-opcua/opcua-client^4.0 — the core OPC UA clientreact/event-loop^1.5 — ReactPHP event loop for the daemonreact/socket^1.16 — Unix socket serverpsr/log^3.0 — PSR-3 logging interface (interface-only, zero runtime code)psr/simple-cache^3.0 — PSR-16 cache interface (interface-only, zero runtime code)
Development Setup
git clone https://github.com/php-opcua/opcua-session-manager.git
cd opcua-session-manager
composer installTest Servers
Integration tests require the OPC UA test server suite:
git clone https://github.com/php-opcua/uanetstandard-test-suite.git
cd uanetstandard-test-suite
docker compose up -dProject Structure
src/
├── Client/
│ ├── ManagedClient.php # Drop-in OpcUaClientInterface proxy
│ └── SocketConnection.php # Unix socket IPC transport
├── Daemon/
│ ├── SessionManagerDaemon.php # ReactPHP long-running daemon
│ ├── CommandHandler.php # IPC command dispatch and security
│ ├── Session.php # Session wrapper (Client + metadata)
│ └── SessionStore.php # In-memory session registry
├── Serialization/
│ └── TypeSerializer.php # Bidirectional JSON ↔ OPC UA type conversion
└── Exception/
├── DaemonException.php # Daemon communication errors
├── SessionNotFoundException.php
└── SerializationException.php
bin/
└── opcua-session-manager # CLI daemon entrypoint
config/
└── defaults.php # Default configuration values
tests/
├── Unit/ # No server or daemon required
└── Integration/ # Requires test servers + daemon
└── Helpers/TestHelper.php # Daemon lifecycle and client helpers