Re: Package Scope Recommendations for File_Ogg
| From: | David Grant | Date: | Thu, 14 Aug 2003 14:43:22 +0000 |
| Subject: | Re: Package Scope Recommendations for File_Ogg | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-19740@lists.php.net to get a copy of this message | ||
> David Grant wrote:
>
>> Having just looked back, I think I may have misunderstood your original
>> message. Do you mean that the PEAR class should utilise the PECL
>> extension if it exists? I believed you to mean that they must share a
>> common API.
> It must not share the API directly, but the common using should be the
> same.
> In early days of PEAR there was a common agreement was, that things
> sould first be implemented in PHP, and later you could move parts from
> the PHP-code to an extension, ie like the pear-extension.
> To clearifiy: The user should use the PEAR-Package independent of an
> installed Package-related extension. Thats the package is slower, if the
> extension isn't installed, this is not your problem.
So to clarify:
function foo()
{
if ($this->extensionLoaded) {
bar()
} else {
$this->bar()
}
}
Correct?
>> Is there a standard method for detecting PECL extensions? Is it the
>> same
>> method as regular PHP extensions?
> PEAR::loadExtension() could be you friend
Looks like the manual could well do with a wee bit of updating:
http://pear.php.net/manual/en/core.pear.php
Thanks for you help.
Regards,
David