Skip to content

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

Merged
jordikroon merged 1 commit into
php:masterfrom
laruence:yar-docs-2026-08-29
Aug 29, 2026
Merged

Yar: add protocol chapter, PIE installation and richer examples#5815
jordikroon merged 1 commit into
php:masterfrom
laruence:yar-docs-2026-08-29

Conversation

@laruence

@laruence laruence commented Aug 29, 2026

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)

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
@jordikroon
jordikroon merged commit 60ce1c5 into php:master Aug 29, 2026
2 checks passed
sy-records added a commit to php/doc-zh that referenced this pull request Aug 30, 2026
* 新增 Yar 协议章节并同步更新 Yar 扩展中文翻译

跟进英文文档修订 (php/doc-en#5815, EN-Revision 60ce1c5c7c):
新增《Yar 协议》章节、三种安装方式(PECL/PIE/源码)、
YAR_ERR_FORBIDDEN 常量,完善并发客户端与核心方法文档。

* Update protocol.xml

---------

Co-authored-by: Luffy <lufei@php.net>
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.

2 participants