Re: [PEPr] +1 for Networking::Net_TrackBack
| From: | Stefan Neufeind | Date: | Tue, 20 Apr 2004 15:07:16 +0000 |
| Subject: | Re: [PEPr] +1 for Networking::Net_TrackBack | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-28149@lists.php.net to get a copy of this message | ||
On 20 Apr 2004 at 22:56, KOYAMA Tetsuji wrote:
> At 20 Apr 2004 13:00:09 -0000,
> PEPr wrote:
> > I'm +1 on this so long as you only include PEAR.php when raising
> > errors, instead of including it everytime.
>
> Hummm...., Do you recomend like this code?
>
>
> function sendPing($url, $data,
> $user_agent = NET_TRACKBACK_DEFAULT_USER_AGENT,
> $charset = null) {
> if (!is_array($data)) {
> require_once 'PEAR.php';
> return PEAR::raiseError('Invalid Ping Data',
> NET_TRACKBACK_ERROR_INVALID_PARAM);
> }
> :
> :
>
>
> I think it is not cool. Why must not include PHP.php everytime?
First of all, I guess you meant "PEAR.php"? And no, it's not included
everytime. There is a require_once, and it is only included when
needed. So imho in case you just need PEAR.php to throw an error this
is a viable solution. You usually expect a package to work, not to
fail, so in the success-case PEAR.php wouldn't be included (loaded,
parsed, compiled, ...) at all.
Stefan