Sources moved to src folder

This commit is contained in:
David Saez 2018-05-04 13:30:00 +02:00
parent 97e75c86cc
commit 065544fd52
3 changed files with 32 additions and 36 deletions

View File

@ -26,7 +26,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 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])) if (isset($argv[1]))
$domain = $argv[1]; $domain = $argv[1];
@ -37,4 +37,3 @@ $whois = new Whois();
$result = $whois->Lookup($domain); $result = $whois->Lookup($domain);
print_r($result); print_r($result);
?>

View File

@ -42,17 +42,17 @@ if (isSet($_GET['query']))
else else
$output = ''; $output = '';
include_once('whois.main.php'); include_once('src/whois.main.php');
include_once('whois.utils.php'); include_once('src/whois.utils.php');
$whois = new Whois(); $whois = new Whois();
// Set to true if you want to allow proxy requests // Set to true if you want to allow proxy requests
$allowproxy = false; $allowproxy = false;
// get faster but less acurate results // get faster but less acurate results
$whois->deep_whois = empty($_GET['fast']); $whois->deep_whois = empty($_GET['fast']);
// To use special whois servers (see README) // To use special whois servers (see README)
//$whois->UseServer('uk','whois.nic.uk:1043?{hname} {ip} {query}'); //$whois->UseServer('uk','whois.nic.uk:1043?{hname} {ip} {query}');
//$whois->UseServer('au','whois-check.ausregistry.net.au'); //$whois->UseServer('au','whois-check.ausregistry.net.au');
@ -116,29 +116,28 @@ else
$out = str_replace('{ver}',$whois->CODE_VERSION,$out); $out = str_replace('{ver}',$whois->CODE_VERSION,$out);
exit(str_replace('{results}', $resout, $out)); exit(str_replace('{results}', $resout, $out));
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
function extract_block (&$plantilla,$mark,$retmark='') function extract_block (&$plantilla,$mark,$retmark='')
{ {
$start = strpos($plantilla,'<!--'.$mark.'-->'); $start = strpos($plantilla,'<!--'.$mark.'-->');
$final = strpos($plantilla,'<!--/'.$mark.'-->'); $final = strpos($plantilla,'<!--/'.$mark.'-->');
if ($start === false || $final === false) return; if ($start === false || $final === false) return;
$ini = $start+7+strlen($mark); $ini = $start+7+strlen($mark);
$ret=substr($plantilla,$ini,$final-$ini); $ret=substr($plantilla,$ini,$final-$ini);
$final+=8+strlen($mark); $final+=8+strlen($mark);
if ($retmark===false) if ($retmark===false)
$plantilla=substr($plantilla,0,$start).substr($plantilla,$final); $plantilla=substr($plantilla,0,$start).substr($plantilla,$final);
else else
{ {
if ($retmark=='') $retmark=$mark; if ($retmark=='') $retmark=$mark;
$plantilla=substr($plantilla,0,$start).'{'.$retmark.'}'.substr($plantilla,$final); $plantilla=substr($plantilla,0,$start).'{'.$retmark.'}'.substr($plantilla,$final);
} }
return $ret; return $ret;
} }
?>

4
testsuite.php Normal file → Executable file
View File

@ -78,7 +78,7 @@ if (!empty($argv[1]) && isset($domains[$argv[1]]))
// Test domains // Test domains
include('whois.main.php'); include('src/whois.main.php');
$whois = new Whois(); $whois = new Whois();
@ -209,5 +209,3 @@ foreach($array2 as $key => $value)
return !isset($difference) ? false : $difference; return !isset($difference) ? false : $difference;
} }
?>