From 065544fd52057294310c1ca5665d49e58fba89a4 Mon Sep 17 00:00:00 2001 From: David Saez Date: Fri, 4 May 2018 13:30:00 +0200 Subject: [PATCH] Sources moved to src folder --- example.cli.php | 3 +-- example.php | 61 ++++++++++++++++++++++++------------------------- testsuite.php | 4 +--- 3 files changed, 32 insertions(+), 36 deletions(-) mode change 100644 => 100755 testsuite.php diff --git a/example.cli.php b/example.cli.php index e519806..ae71ad6 100644 --- a/example.cli.php +++ b/example.cli.php @@ -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. */ -include('whois.main.php'); +include('src/whois.main.php'); if (isset($argv[1])) $domain = $argv[1]; @@ -37,4 +37,3 @@ $whois = new Whois(); $result = $whois->Lookup($domain); print_r($result); -?> \ No newline at end of file diff --git a/example.php b/example.php index f878945..ba7f07e 100644 --- a/example.php +++ b/example.php @@ -42,17 +42,17 @@ if (isSet($_GET['query'])) 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'); @@ -116,29 +116,28 @@ else $out = str_replace('{ver}',$whois->CODE_VERSION,$out); exit(str_replace('{results}', $resout, $out)); -//------------------------------------------------------------------------- - -function extract_block (&$plantilla,$mark,$retmark='') -{ -$start = strpos($plantilla,''); -$final = strpos($plantilla,''); - -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; -} -?> \ No newline at end of file +//------------------------------------------------------------------------- + +function extract_block (&$plantilla,$mark,$retmark='') +{ +$start = strpos($plantilla,''); +$final = strpos($plantilla,''); + +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; +} diff --git a/testsuite.php b/testsuite.php old mode 100644 new mode 100755 index 1f63f05..ce64956 --- a/testsuite.php +++ b/testsuite.php @@ -78,7 +78,7 @@ if (!empty($argv[1]) && isset($domains[$argv[1]])) // Test domains -include('whois.main.php'); +include('src/whois.main.php'); $whois = new Whois(); @@ -209,5 +209,3 @@ foreach($array2 as $key => $value) return !isset($difference) ? false : $difference; } - -?> \ No newline at end of file