Copyright (c) 2001-2003 Thai Open Source Software Center Ltd
10 | All rights reserved.
11 |
12 |
Redistribution and use in source and binary forms, with or without
13 | modification, are permitted provided that the following conditions are
14 | met:
15 |
16 |
17 |
Redistributions of source code must retain the above copyright
18 | notice, this list of conditions and the following disclaimer.
19 |
20 |
Redistributions in binary form must reproduce the above copyright
21 | notice, this list of conditions and the following disclaimer in
22 | the documentation and/or other materials provided with the
23 | distribution.
24 |
25 |
Neither the name of the Thai Open Source Software Center Ltd nor
26 | the names of its contributors may be used to endorse or promote
27 | products derived from this software without specific prior written
28 | permission.
29 |
30 |
31 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
34 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
35 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
36 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
37 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
38 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
39 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
40 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/docbook/docbook-v5.2-os/assembly.nvdl:
--------------------------------------------------------------------------------
1 |
2 |
10 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/docbook/docbook-v5.2-os/dbits.nvdl:
--------------------------------------------------------------------------------
1 |
2 |
10 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/docbook/docbook-v5.2-os/docbook.nvdl:
--------------------------------------------------------------------------------
1 |
2 |
10 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/docbook/jing.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/php/doc-base/048256b6c930d0c2e03903e0e9614d8f85441eb6/docbook/jing.jar
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # PHP Manual Contribution Guide
2 |
3 | ## Introduction
4 |
5 | PHP is well-known for having excellent documentation. That documentation
6 | is created by volunteers who collectively make changes every day, and
7 | actively translated into many languages. This guide is designed for
8 | people who work on the official PHP documentation.
9 |
10 | The manual is built from the documentation using a tool called
11 | [PhD](https://doc.php.net/phd.php). The [local setup](local-setup.md)
12 | chapter explains how to set up a local development environment.
13 |
14 | The manual is written to the [DocBook 5.2](https://tdg.docbook.org/tdg/5.2/)
15 | XML schema, with one change to allow the `` tag to support
16 | more than one ``, ``, or `` as the
17 | [DocBook 5.1](https://tdg.docbook.org/tdg/5.1/classsynopsis) schema does.
18 |
19 | ## Glossary
20 |
21 | This guide uses some terminology that you have to know. Don't worry, it's easy:
22 |
23 | - **author** - person who contributes to the original English manual
24 | - **translator** - person who translates the English manual into another
25 | language
26 | - **{LANG}** - replace it with your two-letter country code, (e.g. when
27 | referring to a mailinglist, `doc-{LANG}@lists.php.net`). Note:
28 | Brazilian Portuguese differs from the rest and it's called *pt_br*
29 | for the Git repo and *pt-br* for the mailing list suffix.
30 |
31 | ## Feedback
32 |
33 | You can report problems or make contributions to this guide by using the
34 | "Edit this page" or "Report a problem" links in the sidebar of each page
35 | of [the online version of this documentation](https://doc.php.net/guide/),
36 | or through [the GitHub repository](https://www.github.com/php/doc-base/).
37 |
--------------------------------------------------------------------------------
/docs/contributing.md:
--------------------------------------------------------------------------------
1 | # Contributing to the PHP Documentation
2 |
3 | You can easily contribute to the PHP documentation
4 | by either [reporting a bug](#report-a-bug)
5 | or by fixing one by [submitting a pull request](#submit-a-pull-request).
6 | As all the repositories are hosted on GitHub,
7 | you will need a GitHub account to do either of these.
8 |
9 |
10 | ## Report a Bug
11 |
12 | If you have found a bug on any of the PHP documentation pages,
13 | you can file a bug report by doing the following:
14 |
15 | - click the "Report a Bug" link in the "Improve This Page" section
16 | on the bottom of the page
17 | - log into GitHub
18 | - add a short description of the bug in the title textbox
19 | - add all necessary details to the description textarea
20 | - click the "Submit new issue" button to file your bug report
21 |
22 |
23 | ## Submit a Pull Request
24 |
25 | There are two ways to make changes to the documentation:
26 | - make [minor changes](#minor-changes) by editing files on GitHub
27 | - make [more complex changes](#more-complex-changes--building-the-php-documentation)
28 | and validate/build the documentation locally on your computer
29 |
30 |
31 | ## Minor changes
32 |
33 | To make trivial changes (typos, shorter wording changes or adding/removing short segments)
34 | all one needs is a web-browser and a GitHub account and doing the following:
35 |
36 | - click the "Submit a Pull Request" link in the "Improve This Page" section
37 | on the bottom of the documentation page
38 | - log into GitHub
39 | - fork the repository (if you have not forked it already)
40 | - make changes
41 | - click the "Commit changes" button
42 | - add a commit message (short description of the change) into the "Commit message" textbox
43 | - write a longer description in the "Extended description" textarea, if needed
44 | - click the "Propose changes" button
45 | - review your changes and click "Create pull request" button
46 |
47 | The repository will run a few basic checks on the changes
48 | (e.g. whether the XML markup is valid, whether trailing whitespaces are stripped, etc.)
49 | and your PR is ready to be discussed with and merged by the maintainers.
50 |
51 |
52 | ## More Complex Changes / Building the PHP documentation
53 |
54 | To build and view the documentation after making more extensive changes
55 | (e.g. adding entire sections or files), you will need to
56 | [set up a local build environment](local-setup.md)
57 | in addition to the language repository you want to
58 | [make the changes](#make-changes-to-the-documentation) to.
59 | If the changes validate and look good, you can
60 | [open a PR](#commit-changes-and-open-a-pr).
61 |
62 | If you'd like to know more about what each repository is
63 | and/or how PHP's documentation is built please refer to
64 | the [overview](overview.md).
65 |
66 |
67 | ### Make changes to the documentation
68 |
69 | [Make your changes](editing.md) keeping in mind the [style guidelines](style.md).
70 |
71 |
72 | ### Commit changes and open a PR
73 |
74 | - commit your changes
75 | - push to your fork
76 | - open a PR in the appropriate language repository
77 |
78 | Once you open a PR, the documentation repository will run a few basic
79 | checks on the changes (e.g. whether the XML markup is valid, whether
80 | trailing whitespaces are stripped, etc.) and your PR is ready to be
81 | discussed with and merged by the maintainers.
82 |
--------------------------------------------------------------------------------
/docs/editing.md:
--------------------------------------------------------------------------------
1 | # Editing manual sources
2 |
3 | Before making any changes to the manual - either the English version or a
4 | translation, make sure you have read the [style guidelines](style.md)!
5 |
6 | ## Editing existing documentation
7 | Simply open the files and edit them.
8 |
9 | ## Adding new documentation
10 | When adding new functions or methods, there are a few options:
11 |
12 | ### Option A: Generating stub using `gen_stub.php`
13 | This is the new preferred way to generate files for new extensions, classes, functions
14 | or methods using [`gen_stub.php`][gen_stub]. The script is found in the [php-src][php-src]
15 | repository and uses the stub files to generate documentation (DocBook) files.
16 |
17 | ### Option B: Generating files using docgen
18 | This is the old preferred way to generate files for new extensions, classes, functions
19 | or methods using [`docgen`][docgen]. The script is found in the [doc-base][doc-base]
20 | repository and uses reflection to generate documentation (DocBook) files.
21 |
22 | ### Option C: Copy skeleton files
23 | This involves copying the skeleton files into the correct location:
24 | ```
25 | cp doc-base/skeletons/method.xml classname/methodname.xml #for new methods
26 | cp doc-base/skeletons/function.xml functions/functionname.xml #for new functions
27 | ```
28 |
29 | Note: *classname*, *methodname* and *functionname* are lowercased names of the
30 | class, method, or function, respectively, not a literal file name.
31 |
32 | Remember the extension folder [structure](structure.md) when copying those files.
33 |
34 | ## Translating documentation
35 | The translation process is described in the [translating chapter](translating.md).
36 |
37 | Changes in the English version are eventually picked up by the translators.
38 | If a change doesn't affect translations (e.g. fixing a typo in English) then the
39 | commit message should start with `[skip-revcheck]`.
40 |
41 | ## Validating your changes
42 | Every time you make changes to documentation sources (both English or translation),
43 | you have to validate your changes to ensure that the manual still builds without error.
44 | The necessary [configure.php][configure.php] script is distributed with the
45 | [doc-base][doc-base] repository, so you should already have it. All you have
46 | to do to validate changes is run configure.php:
47 | ```
48 | $ cd phpdoc
49 | $ php configure.php --with-lang={LANG}
50 | ```
51 | If your language is English you can omit the `with-lang` argument. When the above
52 | outputs something like `"All good. Saving .manual.xml… done."` then you know it validates.
53 | You can commit your changes now.
54 |
55 | ## Commit changes
56 | If you have the appropriate access to the repository, you can commit your modified files.
57 | Otherwise, create a Pull Request to have your changes reviewed by the team.
58 |
59 | ## Viewing changes online
60 | The documentation used on the PHP.net website is rebuilt every few hours from
61 | the latest source pushed to the documentation trees.
62 |
63 | Read more details in [the appendix on public builds](public-builds.md).
64 |
65 | [docgen]: https://github.com/php/doc-base/tree/master/scripts/docgen
66 | [doc-base]: https://github.com/php/doc-base/
67 | [gen_stub]: https://github.com/php/php-src/tree/master/build/gen_stub.php
68 | [php-src]: https://github.com/php/php-src/
69 | [configure.php]: https://github.com/php/doc-base/blob/master/configure.php
70 |
--------------------------------------------------------------------------------
/docs/faq.md:
--------------------------------------------------------------------------------
1 | # Frequently Asked Questions
2 |
3 | ## I'm about to document a new PHP extension. How should I start?
4 | Change your working directory to `phpdoc/doc-base/scripts/docgen/` and execute:
5 | ```sh
6 | php docgen.php -e simplexml -o outdir
7 | ```
8 |
9 | It creates the skeletons that you edit, and then commit.
10 |
11 | Help is available with following command: `php docgen.php -h`.
12 |
13 | ## I created skeletons that contain a bunch of default text, should I commit it?
14 | No! Edit the files, to check the generated content and add more information
15 | before committing. Thinking that it is okay to commit the skeleton files because
16 | you will soon come along and flesh them out might seem like a good idea. However,
17 | temporary often becomes permanent.
18 |
19 | ## Is there an online editor?
20 | No, but [simple changes can be submitted via GitHub](contributing#minor-changes).
21 |
22 | ## How do I add a link to a method?
23 | Use `Class::method`. Note that the case does not matter when adding a link.
24 |
25 | ## If a refentry should not emit versioning information, what should I do?
26 | Add the `role="noversion"` to its ``. Example:
27 | ```xml
28 |
29 | ```
30 |
31 | ## How do I add an external link to the documentation?
32 | All external links are added to `doc-base/entities/global.ent`. Markup looks as follows:
33 | ```xml
34 |
35 | ```
36 | Then you can use this syntax in the documentation:
37 | ```xml
38 | Check out Google
39 | ```
40 | Be sure the file understands the `xlink` namespace, by using `xmlns:xlink="http://www.w3.org/1999/xlink"` in the document element.
41 |
42 | ## When adding a note, should I add a title?
43 | Typically titles are useful for notes, but it's not required.
44 | ```xml
45 |
46 | Foo
47 | Note contents are here.
48 |
49 | ```
50 |
51 | ## A feature became available in PHP X.Y.Z, how do I document that?
52 | Version information for functions is stored inside `versions.xml` within
53 | each extension (e.g. `phpdoc/en/extname/versions.xml`). Changes to functions,
54 | like added parameters, are documented within the changelog section for each page.
55 |
56 | ## A parameter is optional, how is it documented?
57 | Like normal, except `methodparam` receives the `choice="opt"` attribute, and
58 | the `` tag is used to signify the default value.
59 | ```xml
60 |
61 | bool
62 | httponly
63 | false
64 |
65 | ```
66 |
67 | ## I see example.outputs and example.outputs.similar entities, what's the difference?
68 | The `&example.outputs.similar;` entity is used when the output may differ between executions or machines.
69 | The `&example.outputs;` entity output will always, under all conditions, be the same.
70 |
71 | ## I need to add a piece of text to three or more pages, how?
72 | Add the snippet to `en/language-snippets.ent` as an entity and link to the entity within the desired pages.
73 | This is done so translators can update one version of this text.
74 |
75 | ## How do I find missing documentation?
76 | Missing functions (no associated XML files) can be found like so (assuming a doc checkout, and PhD is installed):
77 | ```sh
78 | php doc-base/configure.php
79 | phd --docbook doc-base/.manual.xml --package PHP --format php
80 | php doc-base/scripts/check-missing-docs.php -d output/index.sqlite
81 | ```
82 |
--------------------------------------------------------------------------------
/docs/joining.md:
--------------------------------------------------------------------------------
1 | # Joining the team
2 |
3 | Joining the PHP Documentation team is a simple process, but a process nonetheless.
4 | You don't have to the join the team to [contribute](contributing.md),
5 | but joining the team can be a way to get more involved in the process
6 | and help out with larger projects.
7 |
8 | ## Write to a mailing list
9 | Because official communication is done there, you should write to the proper list.
10 | Say "Hi" and what you're interested in doing. You may feel more comfortable lurking
11 | for a while, or reading the archives, but ultimately let the list know who you are.
12 |
13 | ### For authors
14 | You should send your message to the `phpdoc@lists.php.net` mailing list. You
15 | will need to subscribe to the list in order to send email to it. You can find
16 | [archives of the list on news-web.php.net](https://news-web.php.net/php.doc),
17 | and there is also a form to subscribe to the list there.
18 |
19 | You can subscribe the regular version of the list (you get every
20 | message as it is sent), the digest version (you'll get a daily-or-so
21 | mail containing all of the new messages to the list), or the "no mail"
22 | version which allows you to send a message but doesn't send you any emails
23 | (useful if you just read through the web archive or an NNTP client).
24 |
25 | ### For translators
26 | You should send your message to the appropriate `doc-{LANG}@lists.php.net` mailing list.
27 |
28 | ## Informal discussion
29 | The mailing lists above are the primary communication forum. In particular,
30 | decisions and plans should be made on the list so they are recorded in the
31 | archives.
32 |
33 | However for more realtime and/or informal chat, some doc authors hang out in
34 | "Room 11" on Stackoverflow Chat: https://chat.stackoverflow.com/rooms/11/php
35 |
36 | Some authors hang out in the `#php-doc` channel on IRC on the
37 | https://Libera.Chat network, which is also bridged to the Discord server run
38 | by the PHP Community Foundation, available at https://phpc.chat.
39 |
40 | ## Create a doc patch or three
41 | This step is required to show us that you are a real human, you want to do
42 | some work and in general know how to do this.
43 |
44 | The simplest way to get started is by using GitHub, to create and send Pull Requests
45 | to [php/doc-en][doc-en] or php/doc-{LANG} for translations.
46 |
47 | Your Pull Requests will be then reviewed and accepted by someone with Git commit access.
48 |
49 | ## Obtaining Git commit access
50 | If you plan to contribute to the manual regularly and want to help process
51 | contributions from others, you might want to request to be added to the
52 | documentation team (or a translation team) on GitHub, which you can do on the
53 | email lists.
54 |
55 | To be clear: you don't need Git commit access to start contributing to the
56 | documentation! Anyone with a GitHub account (which is free) can submit Pull
57 | Requests to the documentation repositories.
58 |
59 | [doc-en]: https://github.com/php/doc-en
60 |
--------------------------------------------------------------------------------
/docs/local-setup.md:
--------------------------------------------------------------------------------
1 | # Setting up a local development environment
2 |
3 | This guide assumes that you are comfortable working with on the
4 | command line with tools like Git.
5 |
6 | There are instructions for building [with Docker](#with-docker) or
7 | [without Docker](#without-docker). Building with Docker means that
8 | not all of the related repositories need local clones, and that you
9 | will be building with a version of PHP that is known to work.
10 |
11 | When working with multiple translations, or working on changes that may
12 | also require changing files in the `doc-base` or `phd` repositories, the
13 | suggested way to organize the local enviroment is to clone repositories
14 | into a single `phpdoc` directory, and for individual languages to be cloned
15 | into directories named `{LANG}` instead of `doc-{LANG}` as they are named
16 | on GitHub.
17 |
18 |
19 | ## Building with make and Docker
20 |
21 | - Install Docker (https://docs.docker.com/get-docker/)
22 | - Clone the `doc-en` Git repository
23 | - Rebuild the documentation using `make`
24 | - Open output/php-chunked-xhtml/ in your browser.
25 |
26 | ```sh
27 | $ mkdir phpdoc
28 | $ cd phpdoc
29 | $ git clone https://github.com/php/doc-en.git en
30 | $ cd en
31 | $ make
32 | $ open output/php-chunked-xhtml/index.html
33 | ```
34 |
35 | If the `doc-base` or `phd` repositories are available in directories
36 | adjacent the clone of the `doc-en` repository, those will be used for
37 | building, otherwise the latest revision of those repositories from GitHub
38 | will be built into the Docker image used.
39 |
40 | To force the Docker image used for building to itself be rebuilt, run
41 | `make -B build`, otherwise the `Makefile` will only build it if does not
42 | already exist.
43 |
44 | The web version of the documentation with `make php` and the output will
45 | be placed in `output/php-web`. (See the [additional local web setup
46 | instructions](local-web-setup.md) for details on how to view those.)
47 |
48 |
49 | ## Building without make or Docker
50 |
51 | ## Check out the PHP documentation using Git
52 |
53 | Note that `doc-en` is cloned into the `en` directory below.
54 |
55 | ```
56 | $ mkdir phpdoc
57 | $ cd phpdoc
58 | $ git clone https://github.com/php/phd.git
59 | $ git clone https://github.com/php/doc-base.git
60 | $ git clone https://github.com/php/doc-en.git en
61 | ```
62 |
63 | ## Validate and build `.manual.xml`
64 |
65 | ```
66 | $ php doc-base/configure.php
67 | ```
68 |
69 | Running `configure.php` will check and validate the XML according to the
70 | Docbook specification. It will output either error messages explaining
71 | any problems, or an ASCII cat.
72 |
73 | This creates the file `doc-base/.manual.xml` which can then be used
74 | to generate other formats of the documentation.
75 |
76 | If you are building a translation, you'll also need to specify the
77 | language at this step:
78 |
79 | ```sh
80 | $ git clone https://github.com/php/doc-fr.git fr
81 | $ php doc-base/configure.php --with-lang=fr
82 | ```
83 |
84 | When building a language, you still need to clone both the `doc-en` repository
85 | (again, as `en`) so it can be used as the fallback for files that are not yet
86 | translated.
87 |
88 | ## Build other formats of the documentation
89 |
90 | `phd` can turn the `doc-base/.manual.xml` generated by `configure.php`
91 | into several different formats, including a single HTML file, a
92 | multiple-file ("chunked") HTML version, and a special version of the
93 | HTML used by the PHP.net website.
94 |
95 | ```sh
96 | $ php phd/render.php --docbook doc-base/.manual.xml --package PHP --format xhtml
97 | $ open output/php-chunked-xhtml/index.html
98 | ```
99 |
100 | To build the version for the website (with a [local web setup](local-web-setup.md)):
101 |
102 | ```sh
103 | $ php phd/render.php --docbook doc-base/.manual.xml --package PHP --format php
104 | $ open https://localhost:8080/manual/en/
105 | ```
106 |
--------------------------------------------------------------------------------
/docs/local-web-setup.md:
--------------------------------------------------------------------------------
1 | # Setting up a local web development enviroment
2 |
3 | ## Clone the php.net sources
4 | ```
5 | $ git clone https://github.com/php/web-php.git
6 | ```
7 |
8 | ## Symlink (or move) the generated PHP documentation to your local php.net sources
9 | ```
10 | $ cd web-php/manual
11 | $ rm -rf en
12 | $ ln -s ../../output/php-web en
13 | ```
14 |
15 | Symlinking can also be done on Windows. Just make sure you run `cmd` as an *Administrator*.
16 |
17 | ```
18 | $ cd \your\path\to\web-php\manual\
19 | $ rmdir /S en
20 | $ mklink /D en \your\path\to\output\web-php
21 | ```
22 |
23 | ## Run a webserver
24 | We are going to use PHP's built-in web server. Please open another terminal instance for this task.
25 |
26 | ```
27 | $ cd phpdoc/web-php
28 | $ php -S localhost:8080 .router.php
29 | ```
30 |
31 | ## View the new site
32 | Open [http://localhost:8080/manual/en/](http://localhost:8080/manual/en/) in your browser.
33 |
--------------------------------------------------------------------------------
/docs/public-builds.md:
--------------------------------------------------------------------------------
1 | # How the manual is built for the website
2 |
3 | The manual and all of its translations is automatically rebuilt and
4 | made available at PHP.net through a regular process handled by the
5 | systems team.
6 |
7 | Currently, this happens every few hours.
8 |
9 | If there appear to be problems with the regular building of the manual or
10 | any translation, contact the [PHP Systems team](mailto:systems@php.net)
11 | for help. (The process is automated and monitored, so problems are
12 | generally dealt with promptly.)
13 |
14 | ## CHM builds
15 |
16 | The CHM versions of the manual are currently built by [Yoshinari
17 | Takaoka](https://github.com/mumumu) on an irregular schedule, and are
18 | automatically made available for distribution when they are rebuilt.
19 |
--------------------------------------------------------------------------------
/docs/structure.md:
--------------------------------------------------------------------------------
1 | # Documentation structure
2 |
3 | The PHP Manual sources are stored in Git repositories.
4 |
5 | To checkout the PHP Manual sources, follow the steps in [Setting up a documentation environment](local-setup.md)
6 |
7 | ## File structure
8 |
9 | **Note for translators:** if any of the source files don't exist in your translation, the English content will be used
10 | during the building process. This means that you *must not* place untranslated files in your translation tree. Otherwise,
11 | it will lead to a mess, confusion and may break some tools.
12 |
13 | The structure of the manual sources is hopefully rather intuitive. The most
14 | complicated part is the documentation for extensions, which is also the biggest
15 | part of the manual as all functions are grouped into extensions.
16 |
17 | The documentation for extensions is located in `reference/extension_name/`. For example,
18 | the calendar extension documentation exists in `reference/calendar/`. There you'll find several files:
19 | - *book.xml* - acts as the container for the extension and contains the preface. Other files (like examples.xml)
20 | are included from here.
21 | - *setup.xml* - includes setup, install and configuration documentation
22 | - *constants.xml* - lists all constants that the extension declares, if any
23 | - *configure.xml* - usually this information is in setup.xml, but if the file exists it is magically
24 | included into setup.xml
25 | - *examples.xml* - various examples
26 | - *versions.xml* - contains version information for the extension
27 | - *foo.xml* - example, foo can be anything specific to a topic. Just be sure to include via book.xml.
28 |
29 | A procedural extension (like calendar) also has:
30 | - *reference.xml* - container for the functions, rarely contains any info
31 | - *functions/* - folder with one XML file per function that the extension declares
32 |
33 | And OO extensions (such as imagick) contain:
34 | - *classname.xml* - container for the methods defined by the class, contains also basic info about it
35 | - *classname/* - folder with one XML file per method that the class declares
36 |
37 | Note: *classname* is the lowercased name of the class, not a literal file or directory name.
38 |
39 | There are some other important files:
40 | - *language-defs.ent* - contains local entities used by this language. Some common ones are
41 | the main part titles, but you should also put entities used only by this language's files here.
42 | - *language-snippets.ent* - longer often used XML snippets translated to this language.
43 | Including common warnings, notes, etc.
44 | - *translation.xml* - this file is used to store all central translation info, like a small
45 | intro text for translators and the persons list. This file is not present in the English tree.
46 |
47 | ## `xml:id` structure
48 |
49 | The PHP Manual is complex, and uses `xml:id`s extensively, for various
50 | purposes. So some care is necessary to avoid failures.
51 | There are two types of `xml:id`s used in manuals.
52 |
53 | * **Structural IDs:** IDs that are present on structural elements of
54 | DocBook XML (like ``, `` and so on), that are used for
55 | linking and chunking;
56 |
57 | * **XInclude IDs:** IDs that are used as target of XIncludes.
58 |
59 | Structural IDs are in the pattern `id.id` (always one dot as separator),
60 | while XInclude IDs use the pattern `structural.id..local.name`. That is,
61 | for Structural IDs the name parts are separated with a *single* dot, while
62 | XInclude IDs are composed of an Structural ID prefix, a *double* dot separator,
63 | and a named suffix.
64 |
65 | The `configure.php` script will remove any duplicated IDs found. Without
66 | warnings in the case of XInclude IDs, so it is possible to use XInclude
67 | IDs elsewhere, and will warn about duplicate Structural IDs.
68 |
--------------------------------------------------------------------------------
/docs/tags-and-entities.md:
--------------------------------------------------------------------------------
1 | # Some popular tags and entities
2 |
3 | filenames
4 | constants
5 | variables
6 | a function's parameter/argument
7 | functions, this links to function pages or bolds if
8 | already on the function's page. it also adds ().
9 |
10 | teletype/mono-space font
11 | italics
12 | see HOWTO, includes many other tags.
13 | internal manual links
14 | variables
15 |
16 | external links via global.ent
17 | mmm cookies
18 |
19 | types, this links to the given types manual
20 | page: object -> php.net/types.object
21 |
22 | &return.success; see: language-snippets.ent
23 | &true; TRUE
24 | &false; FALSE
25 | &php.ini; php.ini
26 |
27 | Be sure to check out `entities/global.ent` (in the `doc-base` repo) and
28 | `language-snippets.ent` (located within each language's repo) for more
29 | information for entities and URLs.
30 |
--------------------------------------------------------------------------------
/docs/toc.md:
--------------------------------------------------------------------------------
1 | ## Table of Contents
2 | - [Introduction](README.md)
3 | - [Overview of the build system](overview.md)
4 | - [Contributing to the documentation](contributing.md)
5 | - [Setting up a local build environment](local-setup.md)
6 | - [Editing the PHP Manual](editing.md)
7 | - [Documentation structure](structure.md)
8 | - [Style guidelines](style.md)
9 | - [Coding standard for examples](cs-for-examples.md)
10 | - [Translating documentation](translating.md)
11 | - [Joining the team](joining.md)
12 |
13 | ## Appendices
14 | - [FAQ](faq.md)
15 | - [Tools](tools.md)
16 | - [Frequently used tags and entities](tags-and-entities.md)
17 | - [User Note Editing Guidelines](user-notes.md)
18 | - [Setting up a local web development environment](local-web-setup.md)
19 | - [How the released versions are built](public-builds.md)
20 |
--------------------------------------------------------------------------------
/docs/tools.md:
--------------------------------------------------------------------------------
1 | # Tools
2 |
3 | ## Quality Assurance Tools (QA Tools)
4 |
5 | There are various scripts available to ensure the quality of the documentation
6 | and find issues with it, they are located in the `scripts/qa/` directory.
7 |
8 | There might be some more just in `scripts/` but they need to be checked if they
9 | are still relevant and/or given some love.
10 |
11 | ## Translation Tools
12 |
13 | There are also various scripts to ensure the quality and synchrony of
14 | documentation translations, located in the `scripts/translation/` directory.
15 |
--------------------------------------------------------------------------------
/docs/user-notes.md:
--------------------------------------------------------------------------------
1 | # User Note Editing Guidelines
2 | These are some guidelines to follow when editing user notes in the manual.
3 |
4 | To begin editing user notes in the manual, you must have a PHP.net account, and you must either:
5 | - Subscribe to the `php-notes` mailing list or newsgroup. As a user submits a new user note, it will appear
6 | as a message on the mailing list with links in the footer of the email that enable you to delete, edit,
7 | or reject that particular note.
8 | - Log on to the server at https://main.php.net/manage/user-notes.php using your PHP.net account username and password.
9 | The user notes administration interface enables you to search for user notes that match particular strings
10 | and edit or change the status of particular notes directly through the Web interface.
11 |
12 | The thing that seems to confuse the most people is the difference between *rejecting* and *deleting* a note.
13 | Basically, they both remove the note from the manual, but *rejecting* sends the user an email about the rejection
14 | with links to support links and other information. Here are some guidelines of when to use each. You can also view
15 | the exact text of the rejection email [here](https://github.com/php/web-master/blob/master/manage/user-notes.php).
16 | - If the note is asking for help (support request, *Does this work...?*, etc.) or if the person is reporting a bug,
17 | *reject* the note. The email will show them the proper place to report such issues.
18 | - If the note contains useful information appropriate for the manual proper, you may incorporate the information
19 | into the manual and then *delete* the note.
20 | - If the note is in the wrong place, incorrect, a giant block of silly, unnecessary code, poorly written, an answer
21 | to another person's question, or just overall confusing, *delete* it. If it was an answer to a question, hunt down
22 | that note and *reject* it.
23 | - If the note is in a language other than English, *delete* the note.
24 | - If the note submitter's email address is obviously bogus, don't *reject* the note, just *delete* it.
25 | Rejecting the note just gives the mail server more work trying to send an email to a non-existent address,
26 | which doesn't help anything.
27 |
28 | If for some reason you need to add to a note, first ask yourself if it's worth it. Make sure you're not answering
29 | a user's question; if you are, then the note doesn't belong there (see above). If you're clarifying a point, see
30 | if it is appropriate to add the clarification to the manual proper; if it is, add it and *delete* the note (see above).
31 | If you still feel that adding your addition to the note will be the best option, then go ahead and add it. Usually, editors
32 | add their note in a "Editor's Note" block at the top. Unless you are correcting a minor error, make it obvious that you edited the note.
33 |
34 | If you have some free time and commit access to phpdoc, try going through some of the manual pages and adding some of
35 | the better notes into the documentation proper. Be sure to *delete* these notes after they're implemented.
36 |
37 | If you are in doubt about what to do with a note, you may ask for help on the `php-notes` mailing list (or `phpdoc`,
38 | if what you're doing involves the documentation proper).
39 |
--------------------------------------------------------------------------------
/funcindex.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | &IndexListing;
5 |
6 | &FunctionListing;
7 | &FunctionListingDescription;
8 |
9 |
10 |
11 | &ExampleListing;
12 | &ExampleListingDescription;
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/htmlhelp/README.txt:
--------------------------------------------------------------------------------
1 | ****************************************************************
2 | ** This build system is used to generate the extended CHM **
3 | ** file available from php.net (only in English). There is **
4 | ** a different CHM generator system in the 'chm' folder, **
5 | ** which is used to build the simpler CHM files (in multiple **
6 | ** languages). **
7 | ** **
8 | ** Both of the systems are used in paralell. **
9 | ****************************************************************
10 |
11 | Build system of the extended CHMs
12 | =================================
13 |
14 | [See latest "official" output package online at
15 | http://php.net/docs-echm]
16 |
17 | How to build a CHM manual with this system?
18 |
19 | 0. Ensure that you have the latest phpdoc checkout and the
20 | version information in xsl/version.xml is up-to-date,
21 | so you will build the latest function version information
22 | into the CHM.
23 |
24 | 1. run "autoconf" in the phpdoc directory
25 |
26 | 2. run "./configure --with-chm=yes"
27 |
28 | Optionally you may need to specify the
29 | "--with-xsltproc=path" option to explicitly
30 | provide the XSLTProc path.
31 |
32 |
33 | 3. Run "make chm_xsl"
34 |
35 | If xsltproc encounters errors in the XML files,
36 | correct the errors, commit them to phpdoc, and
37 | run "make chm_xsl" again. There is no need to
38 | reconfigure in most cases.
39 |
40 | After this step the HTML files to start are in
41 | phpdoc/htmlhelp/html
42 |
43 | 4. Get the actual mirrors.inc file from
44 | http://ANY_MIRROR.php.net/include/mirrors.inc
45 | and save into the directory where the
46 | make_chm.bat resides (overwrite old one if
47 | one exists).
48 |
49 | 5. Get all the user notes from
50 | http://ANY_MIRROR.php.net/backend/notes/all.bz2,
51 | extract its contents (using bunzip2 all.bz2, for example),
52 | and place the resulting "all" file to the same folder where
53 | the make_chm.bat resides.
54 |
55 | 6. Copy local_vars.php.src to local_vars.php and
56 | adjust settings as needed.
57 |
58 | 7. Now run make_chm.bat
59 |
60 | Well, this is quite manual right now, and there are
61 | some problems need fixing (see the TODO.txt file too).
62 |
--------------------------------------------------------------------------------
/htmlhelp/TODO.txt:
--------------------------------------------------------------------------------
1 | ! Please contact goba@php.net before modifying
2 | ! the code in the "htmlhelp" folder in CVS.
3 |
4 | Important:
5 |
6 | - Add _function.html to the resulting CHM,
7 | which can redirect to a function page in
8 | the CHM. IDEs without direct PHP manual
9 | support can use this to integrate the CHM.
10 |
11 | - Make the build system support other languages
12 | then English. All the strings used need to be
13 | customizable. This also includes the porting
14 | of the charset conversion added lately to the
15 | "old chm" build system.
16 |
17 | - Make the build system run more automatically.
18 |
19 | - Make the build system run on Unix (except the
20 | hh compiler).
21 |
22 | Additional:
23 |
24 | - Do not clean up the notesin and notesout
25 | directories if recently generated files
26 | are there (the "all" file is older then
27 | those files generated there).
28 |
29 | - Also do not clean up the "htmlout" directory
30 | if the files there are newer then the ones
31 | in the "html" directory.
32 |
33 | - Implement some detection for the $HTML_SRC
34 | and $HTML_TARGET directories, and don't do
35 | cleanups, and some copying, if they are the
36 | same.
37 |
38 | - Experiment with Brendan Ferguson's JS syntax
39 | highlighter and test it's usage in user note
40 | coloring. This would make the resulting CHMs
41 | much smaller, but needs JS magic (may be slow).
42 |
43 | - Document the skin framework, how it works, so
44 | others will be able to create their own skins.
45 |
--------------------------------------------------------------------------------
/htmlhelp/exclude.txt:
--------------------------------------------------------------------------------
1 | CVS
--------------------------------------------------------------------------------
/htmlhelp/local_vars.php.src:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/htmlhelp/make-xchm:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | cd ..
4 | cvs -q up
5 | autoconf
6 | ./configure --with-chm=yes --without-internals
7 | make test
8 | make test_xml
9 | make chm_xsl
10 |
11 | cd htmlhelp
12 | rm -f mirrors.inc all
13 |
14 | wget http://php.net/include/mirrors.inc
15 | wget http://php.net/backend/notes/all.bz2
16 |
17 | bunzip2 all.bz2
18 | ./make_chm.bat
19 | cd release
20 | zip -9 -r php_manual_chm.zip *
21 |
--------------------------------------------------------------------------------
/htmlhelp/make_chm.bat:
--------------------------------------------------------------------------------
1 | @php -f make_chm.php
--------------------------------------------------------------------------------
/htmlhelp/mirrors_ini.php:
--------------------------------------------------------------------------------
1 | $mirrorinfo) {
34 | if ($mirrorinfo[7] == MIRROR_OK) {
35 | fwrite($fp, "mirror = \"$mirror\"\n");
36 | }
37 | }
38 |
39 | fclose($fp);
40 |
41 | ?>
--------------------------------------------------------------------------------
/htmlhelp/split_notes.php:
--------------------------------------------------------------------------------
1 | Previous user note split detected, skipping\n";
14 | }
15 |
16 | // We have no splitted notes files, do it now
17 | else {
18 |
19 | // Open all notes source file for reading
20 | $fp = @fopen("all", "r");
21 | if (!$fp) { die("ERROR: No all notes file present"); }
22 |
23 | // Read through the file, and write individual files
24 | while (!feof($fp)) {
25 | $line = chop(fgets($fp,8096));
26 | if ($line == "") continue;
27 |
28 | // Get data from one line
29 | list($id,$sect,$rate,$ts,$user,$note) = explode("|",$line);
30 | $hash = substr(md5($sect),0,16);
31 |
32 | // Create dir if nonexistent
33 | if (!@is_dir("$NOTES_SRC/" . $hash[0])) {
34 | mkdir("$NOTES_SRC/" . $hash[0], 0700);
35 | }
36 |
37 | // Append line to appropriate file
38 | $nf = fopen("$NOTES_SRC/" . $hash[0] . "/$hash", "a");
39 | fwrite($nf, $line . "\n");
40 | fclose($nf);
41 | }
42 |
43 | // Close all notes file
44 | fclose($fp);
45 |
46 | }
47 |
48 | ?>
--------------------------------------------------------------------------------
/htmlhelp/suppfiles/html/_atw.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/php/doc-base/048256b6c930d0c2e03903e0e9614d8f85441eb6/htmlhelp/suppfiles/html/_atw.gif
--------------------------------------------------------------------------------
/htmlhelp/suppfiles/html/_body.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/php/doc-base/048256b6c930d0c2e03903e0e9614d8f85441eb6/htmlhelp/suppfiles/html/_body.gif
--------------------------------------------------------------------------------
/htmlhelp/suppfiles/html/_code.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/php/doc-base/048256b6c930d0c2e03903e0e9614d8f85441eb6/htmlhelp/suppfiles/html/_code.gif
--------------------------------------------------------------------------------
/htmlhelp/suppfiles/html/_function.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Function Redirect
6 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/htmlhelp/suppfiles/html/_google.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/php/doc-base/048256b6c930d0c2e03903e0e9614d8f85441eb6/htmlhelp/suppfiles/html/_google.gif
--------------------------------------------------------------------------------
/htmlhelp/suppfiles/html/_masterheader.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/php/doc-base/048256b6c930d0c2e03903e0e9614d8f85441eb6/htmlhelp/suppfiles/html/_masterheader.jpg
--------------------------------------------------------------------------------
/htmlhelp/suppfiles/html/_note.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/php/doc-base/048256b6c930d0c2e03903e0e9614d8f85441eb6/htmlhelp/suppfiles/html/_note.gif
--------------------------------------------------------------------------------
/htmlhelp/suppfiles/html/_pixel.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/php/doc-base/048256b6c930d0c2e03903e0e9614d8f85441eb6/htmlhelp/suppfiles/html/_pixel.gif
--------------------------------------------------------------------------------
/htmlhelp/suppfiles/html/_skin_hi.js:
--------------------------------------------------------------------------------
1 | // This is an inline skin file for the "Hi" skin of the PHP Manual.
2 | // This file should be inside the Manual CHM file.
3 |
4 | // Get style sheet file
5 | document.write(
6 | // Get the lo style file
7 | ''
8 | );
9 |
10 | // Display the page to the user
11 | function displayPage() { defaultDisplayPage(); }
--------------------------------------------------------------------------------
/htmlhelp/suppfiles/html/_skin_lo.js:
--------------------------------------------------------------------------------
1 | // This is an inline skin file for the "Lo" skin of the PHP Manual.
2 | // This file should be inside the Manual CHM file.
3 |
4 | // Get style sheet file
5 | document.write(
6 | // Get the lo style file
7 | ''
8 | );
9 |
10 | // Display the page to the user
11 | function displayPage() { defaultDisplayPage(); }
--------------------------------------------------------------------------------
/htmlhelp/suppfiles/html/_subheader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/php/doc-base/048256b6c930d0c2e03903e0e9614d8f85441eb6/htmlhelp/suppfiles/html/_subheader.gif
--------------------------------------------------------------------------------
/htmlhelp/suppfiles/html/_warning.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/php/doc-base/048256b6c930d0c2e03903e0e9614d8f85441eb6/htmlhelp/suppfiles/html/_warning.gif
--------------------------------------------------------------------------------
/htmlhelp/suppfiles/notes/_index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PHP Manual - User Notes
6 |
7 |
8 |
9 |
10 | The objective of this file is to store PHP Manual
11 | User Notes on your machine. This file is not intended
12 | to be used for viewing.
13 |
14 |
15 | Please put this file into the directory of your
16 | local php_manual_LANG.chm, and so you will be able to
17 | read user notes viewing that file.
18 |