Req #18883 [Com]: Consider upgrading to Net_DNS2
| From: | johnjohn | Date: | Sat, 03 Mar 2012 06:26:13 +0000 |
| Subject: | Req #18883 [Com]: Consider upgrading to Net_DNS2 | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-8350@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=18883&edit=1
ID: 18883
Comment by: johnjohn
Reported By: john at delegated dot ca
Summary: Consider upgrading to Net_DNS2
Status: Assigned
Type: Feature/Change Request
Package: Net_DNSBL
Package Version: 1.3.4
PHP Version: 5.3.8
Assigned To: doconnor
New Comment:
Is there any timeline on when/if this patch will be applied?
I'm already using the Net_DNS2 package, and I don't really want to
install the Net_DNS package- especially since it's deprecated now.
Thanks-
John
Previous Comments:
------------------------------------------------------------------------
[2011-12-05 05:55:09] mikepultz
I added a patch file that updates Net_DNSBL to use Net_DNS2; it's pretty
straight
forward- I tested all your examples and they all worked fine after the
patch.
The errors you were getting likely where from the exceptions not being
caught.
Mike
------------------------------------------------------------------------
[2011-12-05 05:53:32] mikepultz
Added #patch bug:18883;patch:netdns2_update;revision:1323064412;.
------------------------------------------------------------------------
[2011-11-21 16:30:39] doconnor
Applying the changes breaks lots of tests now :(
------------------------------------------------------------------------
[2011-11-21 16:21:28] doconnor
<div id="changeset">
<span class="removed">-Status: Open</span>
<span class="added">+Status: Assigned</span>
<span class="removed">-Assigned To:</span>
<span class="added">+Assigned To: doconnor</span>
</div>I'll have a shot at this; and implementing a reset() method for
Services_Trackback -
http://test.pear.php.net:8080/job/Services_Trackback/lastCompletedBuild/testReport
/(root)/Services_Trackback_SpamCheck_DNSBL_Test/test_reset/
------------------------------------------------------------------------
[2011-10-07 19:52:51] nohn
Here is a patch:
Index: Net/DNSBL.php
=====================================================
==============
--- Net/DNSBL.php (revision 317868)
+++ Net/DNSBL.php (working copy)
@@ -27,11 +27,11 @@
* @license http://www.php.net/license/3_01.txt
PHP License 3.01
* @version CVS: $Id$
* @link http://pear.php.net/package/Net_DNSBL
- * @see Net_DNS
+ * @see Net_DNS2
* @since File available since Release 1.0.0
*/
-require_once 'Net/DNS.php';
+require_once 'Net/DNS2.php';
/**
* PEAR::Net_DNSBL
@@ -216,14 +216,18 @@
public function isListed($host, $checkall = false)
{
$isListed = false;
- $resolver = new Net_DNS_Resolver;
+ $resolver = new Net_DNS2_Resolver;
if (!is_string($host)) {
return false;
}
foreach ($this->blacklists as $blacklist) {
- $response = $resolver->query($this->getHostForLookup($host,
$blacklist));
+ try {
+ $response =
$resolver->query($this->getHostForLookup($host,
$blacklist));
+ } catch (Net_DNS2_Exception $e) {
+ $response = false;
+ }
if ($response) {
$isListed = true;
if ($checkall) {
@@ -285,9 +289,9 @@
{
// Currently only works for v4 addresses.
if (filter_var($host, FILTER_VALIDATE_IP)) {
- $ip = $host;
- } else {
- $resolver = new Net_DNS_Resolver;
+ $ip = $host;
+ } else {
+ $resolver = new Net_DNS2_Resolver;
$response = $resolver->query($host);
$ip =
isset($response->answer[0]->address)?$response->answer[0]-
>address:NULL;
}
However, one of the Unit tests is failing. There seems a problem in TXT
record
handling of Net_DNS2, could you please take a look, Daniel?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=18883
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18883&edit=1