Skip to content

php-opcua/examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

OPC UA - PHP- practical examples

A growing collection of opinionated, runnable examples showing how to use php-opcua/opcua-client for real-world tasks — and, just as importantly, how to avoid the mistakes that bite hardest in production.

Each example is self-contained: clone, composer install, run. The point is not to demo a single API call; the point is to deliver an end-to-end shape that already takes care of the things people forget on the first try (reconnection, graceful shutdown, error classification, listener isolation, observability hooks).


What's in the collection

Path Topic Mitigates
iot-data-collection/only-core Long-running daemon (subscriptions) + cron one-shot (readMulti) sharing the same PSR-14 event bus Session loss, blocking listeners, alarm storms, OOM spirals, silent stalls, restart races

More examples land under their own subdirectories as the use cases solidify. The current naming scheme is <category>/<variant><variant> denotes which dependencies and assumptions an example takes on (e.g. only-core = pure opcua-client, no session manager, no framework).


Philosophy

Every example in this folder follows the same three rules.

1. Be opinionated. OPC UA is a flexible spec; the examples take clear positions (subscribe-don't-poll for live data, separate collection from storage, push slow work onto a queue, supervisor that never gives up, etc.). The README of each example explains why — so you can disagree on purpose, not by accident.

2. Mitigate the common mistakes by default. PHP and OPC UA each have failure modes that bite first-time users. The scaffolds wire in the defenses up front, so you start one step ahead and only loosen constraints with intention.


Running any example

cd <category>/<variant>
composer install
# follow the example-specific README for the entry-point command

Most examples accept OPCUA_ENDPOINT and LOG_LEVEL env vars to override the default endpoint and verbosity without editing files.


Related packages


License

Each example carries its own LICENSE file. Unless stated otherwise, all examples are MIT-licensed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages