medz/phpwind
PHPWind SDK for PHP/Laravel that simplifies integrating PHPWind forum data and operations. It offers convenient access to users, forums, threads, and posts, helping developers build bridges, migrations, or custom community features without writing low-level PHPWind queries.
composer require medz/phpwind — first check the composer.json in the repo for its PHP version floor. This is generator-era code, so confirm it installs cleanly on your runtime before you build on it.vendor/autoload.php and confirm the namespace from the README / src/. The package is small; read the main Wind class end-to-end before writing anything. That file is the API.Generator function, yield each async step, and let the runner drive the continuations.use Medz\Wind\Wind; // verify namespace against the repo
$wind = new Wind();
$result = $wind->run(function () {
$a = yield $someAsyncStep(); // suspension point
$b = yield $anotherStep($a); // resumes when $a resolves
return $b; // returned to the runner's caller
});
Whether the entry point is static or instance-based is version-dependent — the shape is the same either way: a factory takes a Generator callable and returns a driver handle you can inspect for completion, errors, or results.
yield is a suspension point; the runner resumes the generator when the yielded value resolves. Use this to collapse nested callbacks in HTTP clients, DB drivers, or queue consumers into something that reads top-to-bottom.yield one flow from another as a sub-step. This is the main testability win — each unit can be driven standalone without the parent.try/catch around suspension points so exceptions thrown by a yielded operation propagate through your flow instead of escaping into the runner loop where you lose context.composer.json and skim the source (it's small) before relying on it. Check open issues for PHP 8.x compatibility and generator edge cases before starting.yield returns a Generator immediately and executes nothing. Forgetting the runner call is the single most common silent failure — no error, no output, no side effects.yield $key => $value may be interpreted differently than a plain yield depending on the runner's continuation handling. Verify against the source before using keys as labels.run() pays for itself the first time a chain hangs.Wind class, not in application code — that's the seam intended for extension and the one place you can safely patch behavior.How can I help you explore Laravel packages today?