Re: curious about PEAR C extensions...
| From: | (Stig Sæther Bakken) | Date: | Tue, 27 Mar 2001 00:11:15 +0000 |
| Subject: | Re: curious about PEAR C extensions... | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-109@lists.php.net to get a copy of this message | ||
["Eduardo Dominguez" <lalo_dominguez@yahoo.com>]
> I am VERY curious about this whole PEAR C extensions.
>
> How do they differ from the extensions that come with PHP
> (like sablotron, bcmath, etc) ?
Apart from being dynamically loaded into PHP, they are no different
from the bundled extensions.
> How is it possible to derive a PHP class from a class
> written in C ?
Like you would use any other class. There's a prototype of the PEAR
base class written in C, see
http://cvs.php.net/viewcvs.cgi/pear/PEAR/INSTALL
for how to install
it. To use it instead of the PHP version, put the pear/PEAR directory
before the lib/php directory in your include path. Then you can use
the C-defined PEAR and PEAR_Error classes just like the old ones.
> What else is possible with this ?
>
> I have a big site that would really welcome a rewrite in C
> of some parts and this would help a lot.
You can of course everything you can do in PHP and more, if you want
to spend the extra coding and debugging time. There are some powerful
features that are available in PHP's C API that you don't have access
to from the script level, such as creating resources and object
overloading.
- Stig
--
Stig Sæther Bakken <ssb@fast.no>
Fast Search & Transfer ASA, Trondheim, Norway