Skip to content

Commit

Permalink
Sources moved to src folder
Browse files Browse the repository at this point in the history
  • Loading branch information
sparc committed May 4, 2018
1 parent 97e75c8 commit 065544f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 36 deletions.
3 changes: 1 addition & 2 deletions example.cli.php
Expand Up @@ -26,7 +26,7 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

include('whois.main.php');
include('src/whois.main.php');

if (isset($argv[1]))
$domain = $argv[1];
Expand All @@ -37,4 +37,3 @@
$result = $whois->Lookup($domain);

print_r($result);
?>
61 changes: 30 additions & 31 deletions example.php
Expand Up @@ -42,17 +42,17 @@
else
$output = '';

include_once('whois.main.php');
include_once('whois.utils.php');
include_once('src/whois.main.php');
include_once('src/whois.utils.php');

$whois = new Whois();

// Set to true if you want to allow proxy requests
$allowproxy = false;

// get faster but less acurate results
$whois->deep_whois = empty($_GET['fast']);

// get faster but less acurate results
$whois->deep_whois = empty($_GET['fast']);

// To use special whois servers (see README)
//$whois->UseServer('uk','whois.nic.uk:1043?{hname} {ip} {query}');
//$whois->UseServer('au','whois-check.ausregistry.net.au');
Expand Down Expand Up @@ -116,29 +116,28 @@
$out = str_replace('{ver}',$whois->CODE_VERSION,$out);
exit(str_replace('{results}', $resout, $out));

//-------------------------------------------------------------------------

function extract_block (&$plantilla,$mark,$retmark='')
{
$start = strpos($plantilla,'<!--'.$mark.'-->');
$final = strpos($plantilla,'<!--/'.$mark.'-->');

if ($start === false || $final === false) return;

$ini = $start+7+strlen($mark);

$ret=substr($plantilla,$ini,$final-$ini);

$final+=8+strlen($mark);

if ($retmark===false)
$plantilla=substr($plantilla,0,$start).substr($plantilla,$final);
else
{
if ($retmark=='') $retmark=$mark;
$plantilla=substr($plantilla,0,$start).'{'.$retmark.'}'.substr($plantilla,$final);
}

return $ret;
}
?>
//-------------------------------------------------------------------------

function extract_block (&$plantilla,$mark,$retmark='')
{
$start = strpos($plantilla,'<!--'.$mark.'-->');
$final = strpos($plantilla,'<!--/'.$mark.'-->');

if ($start === false || $final === false) return;

$ini = $start+7+strlen($mark);

$ret=substr($plantilla,$ini,$final-$ini);

$final+=8+strlen($mark);

if ($retmark===false)
$plantilla=substr($plantilla,0,$start).substr($plantilla,$final);
else
{
if ($retmark=='') $retmark=$mark;
$plantilla=substr($plantilla,0,$start).'{'.$retmark.'}'.substr($plantilla,$final);
}

return $ret;
}
4 changes: 1 addition & 3 deletions testsuite.php 100644 → 100755
Expand Up @@ -78,7 +78,7 @@

// Test domains

include('whois.main.php');
include('src/whois.main.php');

$whois = new Whois();

Expand Down Expand Up @@ -209,5 +209,3 @@ function array_diff_assoc_recursive($array1, $array2)

return !isset($difference) ? false : $difference;
}

?>

0 comments on commit 065544f

Please sign in to comment.