Preparation and Housekeeping
Source directory layout
The source directory for a typical PDO driver is laid out as follows, where SKEL represents a shortened form of the name of the database that the driver is going to connect to. Even though SKEL is presented here in uppercase (for clarity), the convention is to use lowercase characters.
The contents of these files are defined later in this document.
Creating a skeleton
The easiest way to get started is to use the ext_skel shell script found in the PHP build tree in the ext directory. This will build a skeleton directory containing a lot of the files listed above. It can be build by executing the following command from within the ext directory:
This will generate a directory called pdo_SKEL containing the skeleton files that you can then modify. This directory should then be moved out of the php extension directory . PDO is a PECL extension and should not be included in the standard extension directory. As long as you have PHP and PDO installed, you should be able to build from any directory.
Build Specific Headers
The header file config.h is generated by the configure process for the platform for the which the driver is being built. If this header is present, the HAVE_CONFIG_H compiler variable is set. This variable should be tested for and if set, the file config.h should be included in the compilation unit.
The following standard public php headers should be included in each source module:
PDO Interface Headers
The following standard public PDO header files are also included in each source module:
Driver Specific Headers
The typical PDO driver has two header files that are specific to the database implementation. This does not preclude the use of more depending on the implementation. The following two headers are, by convention, standard:
Depending on the implementation details for a particular driver it may be necessary to include the following header:
Сервисы от Prime-Hosting.Ru:
Copyright © 2008-2010