Manual sources structure

Downloading the PHP Documentation Source

The PHP Manual sources are currently stored in our Subversion (SVN) repository. You don't need SVN access to checkout (download) the files, but you do need it if you want to send your changes to our server.

This tutorial assumes that you have basic terminal and Subversion knowledge, although don't worry if you've never used Subversion as only basic commands are used, and our setup is simple (e.g., no branches).

To checkout the documentation source, use a modified version of the following command where you change {LANG} to a desired language, such as en for only English:

svn checkout{LANG} phpdoc-{LANG}

This command creates a directory named phpdoc-{LANG} because the source is the first 'svn checkout' argument, and the second argument defines the directory name that stores the checked out directories and files (this name can be anything you wish). This directory will contain a directory with the sources of your chosen language, named {LANG}, and also doc-base folder, which is home to some helpful tools. The "en" language will always be present, as explained below.

The documentation source is stored under "en". To only edit the source files, and not a translation, use:

svn checkout phpdoc-en

The "modules" directory used by these examples defines a set of SVN external definitions that are configured to checkout multiple source directories. For example:

For example, to translate the manual into French, use "doc-fr" instead of "doc-en":

svn checkout phpdoc-fr

For additional information about language codes and available translations, see

Files structure

Note for translators: if any of the source files don't exist in your translation, the English content will be used during the building process. This means that you must not place untranslated files in your translation tree. Otherwise, it will lead to a mess, confusion and may break some tools.

The structure of the manual sources is hopefully rather intuitive. The most complicated part is the documentation for extensions, which is also the biggest part of manual as all functions are grouped into extensions.

The documentation for extensions is located in /phpdoc/{LANG}/reference/extension_name/. For example, the calendar extension documentation exists in /phpdoc/{LANG}/reference/calendar/. There you'll find several files:

A procedural extension (like calendar) also has:

And OO extensions (such as imagick) contain:

Note: classname is the lowercased name of the class, not a literal file or directory name.

There are some other important files, not related with extensions.

The next chapter will discuss how to edit the manual sources.