Download the PHP package flyokai/misc without Composer
On this page you can find all versions of the php package flyokai/misc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package misc
flyokai/misc
User docs →
AGENTS.mdA grab-bag of small utilities that don't deserve their own packages: cryptographic key handling, profiling, PSR-7 ↔ AMPHP bridging, and async sequencing.
These helpers exist because they're shared between two or more flyokai packages and are too small to release individually.
Features
CryptKey— secure OpenSSL key holder (RSA, EC) with file-permission validation, derived fromleague/oauth2-serverProfilerFacade/ProfilerStat— Magento-style nested profiler with memory trackingPsrServerAdapter— bidirectional AMPHP HTTP ↔ PSR-7 converterSharedSequence— monotonic position-based fiber synchronisation primitive
Installation
CryptKey
- Accepts a path with or without
file://prefix, or raw PEM material - Validates RSA / EC types via OpenSSL on construction
- Refuses files whose mode isn't one of
400,440,600,640,660(configurable via$keyPermissionsCheck)
ProfilerFacade
A static profiling facade with nested timers and memory metrics:
When disabled (the production default), every call is a silent no-op. Hierarchy is expressed through -> separators in timer IDs.
ProfilerStat::getFilteredTimerIds($thresholds, $filterRegex) returns timers above given thresholds, optionally filtered by regex.
PsrServerAdapter
Used by the OAuth server to bridge League OAuth2 (PSR-7) with the AMPHP HTTP server:
| Method | Direction |
|---|---|
toPsrServerRequest(Request) |
AMPHP → PSR-7 |
fromPsrServerRequest(PsrServerRequest, Client) |
PSR-7 → AMPHP |
toPsrServerResponse(Response) |
AMPHP → PSR-7 |
fromPsrServerResponse(PsrResponse, Request) |
PSR-7 → AMPHP |
Headers, cookies, query params, attributes and the body are mapped. Pass withBody: false to drop the body.
SharedSequence
A coroutine-ordering primitive — fibers wait until a monotonic position is reached:
await(int $position): void— suspends the current fiber until$positionis reachedresume(int $position): void— sets position tomax($position, $current) + 1and resumes all matching waiters
Position only ever moves forward — once advanced past a value, you can't await it again.
Gotchas
CryptKeymay try to read your raw key as a path — if the literal happens to be a valid file path, OpenSSL will load that file instead. Inspect input.ProfilerFacadeis silent when disabled —getAllStat()returns an empty array. There's no warning that profiling is off.PsrServerAdapterbuffers the body intoPsrServerRequest()— inefficient for very large requests.SharedSequenceis strictly monotonic — once advanced, earlier positions can't be awaited.
See also
flyokai/oauth-serverusesCryptKeyandPsrServerAdapter.flyokai/symfony-consoleships aCryptKeyValidatorbuilt onCryptKey.
License
MIT
All versions of misc with dependencies
amphp/http-client-psr7 Version ^1.1
amphp/http-client-guzzle-adapter Version ^1.1
cuyz/valinor Version ^1.12