diff options
author | Sascha Schumann <sas@php.net> | 2000-05-02 21:51:48 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2000-05-02 21:51:48 +0000 |
commit | bf58db4bc2399b73ec5b5c1e25f71c49d5b00fa8 (patch) | |
tree | 949c2905e51a25bff1f29cb427d7c3b64b85b4d3 /README.SELF-CONTAINED-EXTENSIONS | |
parent | 79a89ef8fec1e190014b615b6fe282f060500d65 (diff) | |
download | php-git-bf58db4bc2399b73ec5b5c1e25f71c49d5b00fa8.tar.gz |
Verbose "give the reader a quick success" tutorial
Diffstat (limited to 'README.SELF-CONTAINED-EXTENSIONS')
-rw-r--r-- | README.SELF-CONTAINED-EXTENSIONS | 61 |
1 files changed, 42 insertions, 19 deletions
diff --git a/README.SELF-CONTAINED-EXTENSIONS b/README.SELF-CONTAINED-EXTENSIONS index 5e7b3763d6..9098e40af6 100644 --- a/README.SELF-CONTAINED-EXTENSIONS +++ b/README.SELF-CONTAINED-EXTENSIONS @@ -1,5 +1,7 @@ -HOW TO CREATE A SELF-CONTAINED PHP EXTENSION $Id$ +============================================================================= + +HOW TO CREATE A SELF-CONTAINED PHP EXTENSION A self-contained extension can be distributed independently of the PHP source. To create such an extension, three things are @@ -13,7 +15,40 @@ $Id$ together. -SPECIFYING THE EXTENSION +CONVERTING AN EXISTING EXTENSION + + Just to show you how easy it is to create a self-contained + extension, we will convert an embedded extension into a + self-contained one. Install PHP and execute the following + commands. + + $ mkdir /tmp/newext + $ cd /tmp/newext + + You now have an empty directory. We will copy the files from + the mysql extension: + + $ cp -rp php-4.0.X/ext/mysql/* . + + It is time to finish the module. Run: + + $ phpize + + You can now ship the contents of the directory - the extension + can live completely on its own. + + The user instructions boil down to + + $ ./configure \ + [--with-php-config=/path/to/php-config] \ + [--with-mysql=MYSQL-DIR] + $ make install + + The MySQL module will either use the embedded MySQL client + library or the MySQL installation in MYSQL-DIR. + + +DEFINING THE NEW EXTENSION Our demo extension is called "foobar". @@ -84,23 +119,11 @@ CREATING THE SELF-CONTAINED EXTENSION And that's it. You now have a self-contained extension. - It can be installed by running: +INSTALLING A SELF-CONTAINED EXTENSION - $ ./configure [--with-php-config=/path/to/php-config] - $ make install + An extension can be installed by running: -CONVERTING AN EXISTING EXTENSION - - If you want to distribute an extension from the PHP repository, copy - all files from the extension's directory to a new directory and - run phpize as described above. That's all! - - For example: - - $ dir=/tmp/new_moduke - $ cd php4/ext/mysql - $ mkdir $dir - $ cp -rp * $dir - $ cd $dir - $ phpize + $ ./configure \ + [--with-php-config=/path/to/php-config] + $ make install |