Skip to content

Yar: add protocol chapter, PIE installation and richer examples - #5814

Closed
laruence wants to merge 1 commit into
php:masterfrom
laruence:yar-docs-2026-08-29
Closed

Yar: add protocol chapter, PIE installation and richer examples#5814
laruence wants to merge 1 commit into
php:masterfrom
laruence:yar-docs-2026-08-29

Conversation

@laruence

Copy link
Copy Markdown
Member

Summary

Follow-up on the Yar documentation rework (#5804): this makes the manual cover the wire protocol, offer the modern PIE installation path, and ship substantially more complete examples and usage notes.

Changes

1. A new "The Yar Protocol" chapter (placed before the installation chapter)

  • Documents the 82-byte binary header layout, the packager-prefixed body and the network-byte-order fields
  • Includes a self-contained plain-PHP client example that calls a Yar service without the extension
  • Documents the YAR_ERR_FORBIDDEN constant, which the extension registers for failed server authentication but was missing from the manual

2. PIE installation

  • The setup chapter now covers three installation methods: PECL (marked as moved), PIE (pie install laruence/yar, including the --enable-msgpack variant) and building from source

3. More complete examples and usage notes

  • Yar_Client::call() previously had no examples section at all; it now shows the magic-method form, the explicit form, and when call() itself is needed
  • Yar_Concurrent_Client now explains the design (batch several independent calls; the total waiting time drops to the slowest single call), why only HTTP(S) is supported (calls are dispatched through curl's multi-handle interface, which the socket transport does not implement), the callinfo array layout, and what happens when no callback/error callback is set (return value printed / PHP warning raised)
  • Example URIs unified to http://api.example.com/operator.php instead of placeholder hostnames

Validation

  • docbook-cs on the full reference/yar/ directory: 31 files scanned, no violations
  • doc-base/configure.php --with-partial=book.yar validates cleanly
  • Rendered with phd (PHP chunked XHTML package) without errors

…ations

- add a "The Yar Protocol" chapter describing the 82-byte binary header
  and body layout, with a plain-PHP client example, and place it before
  the installation chapter
- document the YAR_ERR_FORBIDDEN constant (registered by the extension
  for failed authentication)
- add examples to Yar_Client::call and explain the __call magic-method
  relationship
- Yar_Concurrent_Client: explain the parallel-call design (independent
  calls only, total waiting time bounded by the slowest call), why only
  HTTP(S) is supported, the callinfo array layout, and the fallbacks when
  no callback/error_callback is set
- use a meaningful example URI (http://api.example.com/operator.php)
  instead of placeholder hostnames
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant