Share phpDocumentor output

phpdoc -d src -t docs/ builds a browsable API reference: a namespace tree, a page per class, inherited members resolved, and a search box. Like most generated documentation sites it assumes it will be served over HTTP — open index.html from disk and the search index request fails silently.

Generate

phpdoc -d src -t docs/

Or via the PHAR / Composer binary in CI:

./vendor/bin/phpdoc -d src -t docs/

Publish the folder

Drag docs/ (or a zip of it) into the app:

  • index.html becomes the report body.
  • Class and namespace pages, css/, js/ and the search index upload as assets, with their relative references rewritten to the uploaded copies.
  • Scripts run inside a sandboxed iframe (allow-scripts, no allow-same-origin), so navigation and search behave.

No web server, no docs/ in git, one URL for the whole reference.

From CI

./vendor/bin/phpdoc -d src -t docs/

curl -fsS -X PATCH "https://commareports.com/api/v1/reports/$REPORT_ID" \
  -H "Authorization: Bearer $COMMA_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --rawfile html docs/index.html \
        --arg title "API docs — $CI_COMMIT_REF_NAME" \
        '{title: $title, html: $html}')"

PATCH one report id per package: a stable link, a revision per release. See the API docs for uploading the rest of the folder as assets.

What review adds

  • Anchored threads on a class or method — undocumented throws, stale @param types, examples that no longer compile. See commenting on HTML.
  • Access per report — private for an internal package, public for an open source one. See the sharing model.

Limits

  • Entry HTML: 5 MB. Assets: 25 MB per file, 250 MB and 500 files total. A framework-sized codebase can approach the file cap; publish per component if it does.
  • 60 requests/minute per token.

Try it

Comma is free — unlimited reports, unlimited commenters, unlimited revision history.

Publish generated docs →

Related