PHPackages                             sphpdox/sphpdox - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sphpdox/sphpdox

ActiveLibrary

sphpdox/sphpdox
===============

PHPDoc to Sphinx phpdomain tool

v1.0(10y ago)4817.2k16[7 issues](https://github.com/varspool/sphpdox/issues)1GPL-3.0+PHPPHP &gt;=5.5.9CI failing

Since Dec 15Pushed 6y ago10 watchersCompare

[ Source](https://github.com/varspool/sphpdox)[ Packagist](https://packagist.org/packages/sphpdox/sphpdox)[ Docs](http://github.com/varspool/sphpdox)[ RSS](/packages/sphpdox-sphpdox/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (2)Used By (1)

Sphpdox
=======

[](#sphpdox)

PHPDoc to Sphinx phpdomain
--------------------------

[](#phpdoc-to-sphinx-phpdomain)

Writing ReStructuredText documentation for your PHP project? Already have well documented PHP code using docblocks? Use this to generate API documentation compatible with Sphinx's [sphinxcontrib-phpdomain](http://packages.python.org/sphinxcontrib-phpdomain/).

The name is a mixture of 'sphinx' and 'phpdoc'.

### Installing

[](#installing)

Compatible with PSR-0. The vendor namespace is **Sphpdox**.

#### composer

[](#composer)

Sphpdox is available on Packagist as `sphpdox/sphpdox`.

```
    {
        ...
        "require": {
            "sphpdox/sphpdox": "dev-master"
        }
    }
```

### What It Does

[](#what-it-does)

Sphpdox reads a directory of your namespaced source code. It finds documented classes, methods, properties, etc. and produces documentation in ReStructuredText format, using the `phpdomain` available as part of `sphinxcontrib`. It takes a library like this:

```
lib
├── SplClassLoader.php
└── Wrench
    ├── Application
    │   ├── Application.php
    │   └── EchoApplication.php
    ├── BasicServer.php
    ├── Client.php
    ├── ConnectionManager.php
    ├── Connection.php
    ├── Frame
    │   ├── Frame.php
    │   └── HybiFrame.php
    ├── Listener
    │   ├── HandshakeRequestListener.php
    │   ├── Listener.php
    │   ├── OriginPolicy.php
    │   └── RateLimiter.php
    ├── Payload
    │   ├── HybiPayload.php
    │   └── Payload.php
    ├── Protocol
    │   ├── Hybi10Protocol.php
    │   ├── HybiProtocol.php
    │   ├── Protocol.php
    │   └── Rfc6455Protocol.php
    ├── Resource.php
    ├── Server.php
    ├── Socket
    │   ├── ClientSocket.php
    │   ├── ServerClientSocket.php
    │   ├── ServerSocket.php
    │   ├── Socket.php
    │   └── UriSocket.php
    └── Util
        ├── Configurable.php
        └── Ssl.php

```

And turns it into a documentation tree, like this:

```
build/Wrench/
├── Application
│   ├── Application.rst
│   ├── EchoApplication.rst
│   └── index.rst
├── BasicServer.rst
├── Client.rst
├── ConnectionManager.rst
├── Connection.rst
├── Frame
│   ├── Frame.rst
│   ├── HybiFrame.rst
│   └── index.rst
├── index.rst
├── Listener
│   ├── HandshakeRequestListener.rst
│   ├── index.rst
│   ├── Listener.rst
│   ├── OriginPolicy.rst
│   └── RateLimiter.rst
├── Payload
│   ├── HybiPayload.rst
│   ├── index.rst
│   └── Payload.rst
├── Protocol
│   ├── Hybi10Protocol.rst
│   ├── HybiProtocol.rst
│   ├── index.rst
│   ├── Protocol.rst
│   └── Rfc6455Protocol.rst
├── Resource.rst
├── Server.rst
├── Socket
│   ├── ClientSocket.rst
│   ├── index.rst
│   ├── ServerClientSocket.rst
│   ├── ServerSocket.rst
│   ├── Socket.rst
│   └── UriSocket.rst
└── Util
    ├── Configurable.rst
    ├── index.rst
    └── Ssl.rst

```

Where each file contains documentation for a class, like this:

```
.. php:class:: DateTime

  Datetime class

  .. php:method:: setDate($year, $month, $day)

      Set the date.

      :param int $year: The year.
      :param int $month: The month.
      :param int $day: The day.
      :returns: Either false on failure, or the datetime object for method chaining.

  .. php:method:: setTime($hour, $minute[, $second])

      Set the time.

      :param int $hour: The hour
      :param int $minute: The minute
      :param int $second: The second
      :returns: Either false on failure, or the datetime object for method chaining.

  .. php:const:: ATOM

      Y-m-d\TH:i:sP
```

### Usage

[](#usage)

`./sphpdox.php help` for help. The main command is `process`. If you don't supply any arguments, you'll be asked interactively.

Here's the built-in help for the `process` command:

```
$./sphpdox.php help process
Usage:
 process [-o|--output="..."] [-t|--title="..."] [-x|--exclude="..."] namespace path

Arguments:
 namespace      The namespace to process
 path           The path the namespace can be found in

Options:
 --output (-o)  The path to output the ReST files (default: build)
 --title (-t)   An alternate title for the top level namespace
 --exclude (-x) Semicolon separated namespaces to ignore

Help:
 The process command works recursively on a directory of PHP code.

```

### Libraries

[](#libraries)

Sphpdox uses the Symfony Console component, and PHP-Token-Reflection. I strongly recommend you use composer to install sphpdox, to avoid hunting down dependencies.

### License

[](#license)

sphpdox is released under GPL-3.0+

###  Health Score

37

—

LowBetter than 84% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3750d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7972f8f29b6eda4b2ffa4d6e087a3551b2d909090d2bbcdb212b29a86fed07b?d=identicon)[dominics](/maintainers/dominics)

---

Top Contributors

[![dominics](https://avatars.githubusercontent.com/u/97427?v=4)](https://github.com/dominics "dominics (21 commits)")[![victorhaggqvist](https://avatars.githubusercontent.com/u/1887628?v=4)](https://github.com/victorhaggqvist "victorhaggqvist (9 commits)")[![bd808](https://avatars.githubusercontent.com/u/6469?v=4)](https://github.com/bd808 "bd808 (5 commits)")[![sabbelasichon](https://avatars.githubusercontent.com/u/13050560?v=4)](https://github.com/sabbelasichon "sabbelasichon (4 commits)")[![jurgenf](https://avatars.githubusercontent.com/u/111112?v=4)](https://github.com/jurgenf "jurgenf (2 commits)")[![edrush](https://avatars.githubusercontent.com/u/4974858?v=4)](https://github.com/edrush "edrush (1 commits)")[![deceze](https://avatars.githubusercontent.com/u/137217?v=4)](https://github.com/deceze "deceze (1 commits)")

---

Tags

phpdocdocumentationsphinxrst

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sphpdox-sphpdox/health.svg)

```
[![Health](https://phpackages.com/badges/sphpdox-sphpdox/health.svg)](https://phpackages.com/packages/sphpdox-sphpdox)
```

###  Alternatives

[phpdocumentor/phpdocumentor

Documentation Generator for PHP

4.4k3.1M803](/packages/phpdocumentor-phpdocumentor)[apigen/apigen

PHP source code API generator.

2.2k627.3k190](/packages/apigen-apigen)[daux/daux.io

Documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly

826188.8k1](/packages/daux-dauxio)[yiisoft/yii2-apidoc

API Documentation generator for the Yii framework 2.0

267698.8k25](/packages/yiisoft-yii2-apidoc)[code-lts/doctum

Doctum, a PHP API documentation generator. Fork of Sami

35075.7k24](/packages/code-lts-doctum)[pronamic/wp-documentor

Documentation Generator for WordPress.

6528.8k4](/packages/pronamic-wp-documentor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
