Download & Extend

Refactor whois_get_whois()

Project:Whois lookup
Version:6.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Here is a patch which splits this function into whois_get_whois() and whois_display_whois(). That way, it becomes possible for other modules to use this module as a wrapper around the phpwhois library.

It also moves the watchdog function into the whois_get_whois() function so when other modules do a lookup it's logged.

AttachmentSize
refactor_whois_get_whois.patch4.54 KB

Comments

#1

Status:active» needs review

#2

Status:needs review» reviewed & tested by the community

The patch installs fine with no errors and it doesn't break the module after testing it.

I like this code change because it splits a function into two smaller more focused functions so that the process of retrieving a whois object and the process of displaying the result of the whois object are now two different functions.

Good job deviantintegral.

#3

I'm sorry to report that it did break the selected output method. Since the line fetching of whois_output_method was lost the basic method was always shown.

I've taken the liberty to address several other code style issues inspired by code-style.pl

Attached are patches both against 1.1 and against 1.1 + refactor_whois_get_whois.patch

AttachmentSize
refactor_whois_get_whois-1_incremental.patch 1.49 KB
refactor_whois_get_whois-1.patch 5.51 KB

#4

Hey man, i rcv an error while
=====
patching patching file whois.module
Hunk #1 FAILED at 11.
Hunk #2 FAILED at 102.
Hunk #3 FAILED at 111.
Hunk #4 FAILED at 156.
Hunk #5 FAILED at 186.
Hunk #6 FAILED at 201.
6 out of 6 hunks FAILED -- saving rejects to file whois.module.rej
=====
patching file whois.module
Hunk #1 FAILED at 164.
Hunk #2 FAILED at 186.
2 out of 2 hunks FAILED -- saving rejects to file whois.module.rej
=====

Any idea why? I ran the "# patch < refactor_whois_get_whois-1.patch" and "# patch < refactor_whois_get_whois-1_incremental.patch" command. Any idea?

-Xyber.

#5

Do you have a clean version of whois-6.x-1.1.tar.gz extracted?

Try using the -p1 option while while you are inside the whois directory,

It should look like:

$ patch < refactor_whois_get_whois-1.patch
patching file whois.module

PS: The incremental version is only usefull if you already applied refactor_whois_get_whois.patch, so you probably don't need it.

#6

Hi,

Yes its a clean extraction. But it produces the error. If i add the p1 option it just stays there until i break operation.

-Xyber.

#7

Unless patch isn't getting input, it should just finish or produce an error.

I asked a friend to verify that the patchfile is ok, and he could confirm this.

Have you looked at http://drupal.org/patch/apply ? It might help you track down the problem.

#8

Status:reviewed & tested by the community» fixed

Did an uninstall and reinstalled again. Didn't produce the error. Thanks man!

-Xyber.

#9

Status:fixed» needs review

#10

Status:needs review» fixed

Committed

#11

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#12

Glad to hear this was committed - thanks!

#13

I am beginner of drupal and got this error...
patching patching file whois.module
Hunk #1 FAILED at 11.
Hunk #2 FAILED at 102.
Hunk #3 FAILED at 111.
Hunk #4 FAILED at 156.
Hunk #5 FAILED at 186.
Hunk #6 FAILED at 201.
6 out of 6 hunks FAILED -- saving rejects to file whois.module.rej

Anyway, Can I use whois module in ubercart modules? (e.g. I want to let user chose unregistered domain name and its goes in his order)
thx

#14

As you can read in #10 this patch has already been integrated, therefore there is no need to apply this anymore.

Regarding ubercart, this question would better fit in a new issue. But to give a quick answer: you probably could with some minor glue code but I haven't tried it.

No worries everyone was new here once.

#15

helmo

Thanks for your reply!

Little Druper