Before we start discussing code issues, you should familiarize yourself with the source tree to be able to quickly navigate
through PHP's files. This is a must-have ability to implement and debug
extensions.
After extracting the PHP archive, you'll see a directory layout similar to that in Figure 9.2.
The following table describes the contents of the major directories.
Discussing all the files included in the PHP package is beyond the scope of this chapter.
However, you should take a close look at the following files:
php.h, located in the main PHP
directory. This file contains most of PHP's macro and API definitions.
zend.h, located in the main Zend
directory. This file contains most of Zend's macros and definitions.
zend_API.h, also located in the Zend
directory, which defines Zend's API.
You should also follow some sub-inclusions from these
files; for example, the ones relating to the Zend executor, the PHP
initialization file support, and such. After reading these files, take
the time to navigate around the package a little to see the interdependencies
of all files and modules - how they relate to each other and especially how they
make use of each other. This also helps you to adapt to the coding style in which PHP is authored. To extend PHP, you should quickly adapt to this style.
Zend is
built using certain conventions; to avoid breaking its standards, you should follow the rules described in the following sections.