collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18365
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Persistent Whois cache with out-of-bot upgrading  (Read 76649 times)

0 Members and 6 Guests are viewing this topic.

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #150 on: February 26, 2007, 07:51:48 am »
Yep, I have same issue, it's no concern really tho as I prefer having the whois updating script in a different directory running with PHP4, while the bot is in main directory running PHP5.

-jj-

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #151 on: February 26, 2007, 12:49:39 pm »
What's the problem exactly? I don't have php5 anywhere yet, so I don't know what I have to change to get it running with it.

I'll replace mysql_escape_string with mysql_real_escape_string in the next version to remove the deprecated warning.

Offline Pharexys

  • BeBot Apprentice
  • ***
  • Posts: 117
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #152 on: February 26, 2007, 08:29:02 pm »
works great to me :D even moved from windows to linux and no problems :D

Offline Evereane

  • BeBot Rookie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #153 on: February 27, 2007, 08:44:37 am »
Code: [Select]
Processing Update ...
Update began at Tue Feb 27, 2007 12:47 am

================================================
260 http queries for org information done!
1995 total http queries done!
54333 entries in database associated with an org modified!
55969 entries in database modified!
55969 entries in the whois cache!
31min 15sec runtime for org updates!
40min 17sec total runtime!
================================================

Update concluded at Tue Feb 27, 2007 1:27 am

I edited the update script to output to a directory so I can see the changes. But it runs in PHP 5.2.1 and I don't get any errors  ???

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #154 on: March 01, 2007, 06:15:31 pm »
I configured the whois-update.conf and have it in the same directory as my w_update.php file.  When I run the php file I get:

Fatal error: Call to undefined function mysql_connect() in C:\BeBot\w_update.php
 on line 117

----------

Line 117: $link = mysql_connect("localhost", $username, $password)
You seem to be missing the mysql library for your php5 version. Looks like it isn't statically linked, so you'll have to add a php.ini file for it.

Offline shadowballs

  • BeBot Rookie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #155 on: March 28, 2007, 02:50:40 am »
Ive just recently started using BeBot as main guild chat bot, and so far after added a lot of modules Im starting to like it, however Ive got this little problem with the whois-cache.

Code: [Select]
C:\Program Files (x86)\BeBot_v0.2.11\whoiscache>php.exe w_update.php
PHP Notice:  Use of undefined constant host - assumed 'host' in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 18
PHP Notice:  Use of undefined constant path - assumed 'path' in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 37
PHP Notice:  Use of undefined constant query - assumed 'query' in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 38
PHP Notice:  Use of undefined constant timed_out - assumed 'timed_out' in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 61
PHP Notice:  Use of undefined constant timed_out - assumed 'timed_out' in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 83
PHP Notice:  Use of undefined constant host - assumed 'host' in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 18
PHP Notice:  Use of undefined constant path - assumed 'path' in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 37
PHP Notice:  Use of undefined constant query - assumed 'query' in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 38
PHP Notice:  Use of undefined constant timed_out - assumed 'timed_out' in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 61
PHP Notice:  Use of undefined constant timed_out - assumed 'timed_out' in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 83

>snip<

PHP Notice:  Use of undefined constant timed_out - assumed 'timed_out' in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 83
PHP Notice:  Undefined offset:  1 in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 112
PHP Notice:  Undefined offset:  1 in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 112
PHP Notice:  Undefined offset:  1 in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 112
PHP Notice:  Undefined offset:  1 in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 112


================================================
5 http queries for org information done!
8 total http queries done!
1090 entries in database associated with an org modified!
1092 entries in database modified!
1093 entries in the whois cache!
1min 9sec runtime for org updates!
1min 26sec total runtime!
================================================

C:\Program Files (x86)\BeBot_v0.2.11\whoiscache>

while it does look like it completes the script the PHP Notice: spam is huge and it grows in size everytime the cache grows so Im starting to wonder if its healthy ;)

Code: [Select]
$username = "*******"; // the user name for accessing the database server
$password = "*******"; // the password to access the database server
$dbname = "********"; // the database to use
$dimension = "1";
$dbserver = "localhost"; // the server the DB runs on, localhost in most cases
$tablename = "whois"; // name of the whois table
$thistime = time();
$hours = 36; // after how many hours without an update delete an existing entry?
// used to get rid of stale entries of non-existing/no longer existing characters
$delaytime = 1000; // microseconds to wait after each parse step to reduce load on the http server of FC
[code]
here's my whois-update.conf file and Im using the files linked to in the first post with php version 5.2.1

would this 'problem' go away if I used for example a php4 exe on the update script?
[/code]

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #156 on: March 28, 2007, 02:57:19 am »
here's my whois-update.conf file and Im using the files linked to in the first post with php version 5.2.1

would this 'problem' go away if I used for example a php4 exe on the update script?
Tbh I don't have any clue what's happening.

If you can, try it with some other php version, I'm still using 4.3 here.

It could be some oversensitive settings in your php ini too though which result in all notices spammed.

I'll try to get around to check those lines in the notices tomorrow, perhaps it helps.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #157 on: March 28, 2007, 03:07:32 am »
Quote
PHP Notice:  Use of undefined constant host - assumed 'host' in C:\Program Files (x86)\BeBot_v0.2.11\whoiscache\w_update.php on line 18

If you have a look at line 18 of that script you will probably see an array like $myArra[host] which should have been $myArray['host']

These are notices and not errors nor even warnings and the update should function if these are the only thing "wrong".

To not have to see these notices adjust your php.ini to supress notices (ie. just show errors and warnings).

But "the right way" to fix it is to use strings in array indexes instead of undefined constants. (ie. $myArray['host'] in stead of $myArray[host])

Hope that helps.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #158 on: March 28, 2007, 11:56:40 am »
If you have a look at line 18 of that script you will probably see an array like $myArra[host] which should have been $myArray['host']
[...]
But "the right way" to fix it is to use strings in array indexes instead of undefined constants. (ie. $myArray['host'] in stead of $myArray[host])

Hope that helps.
Nice analysis there, was exactly that.

I've updated the script on the first page, it should fix those notices (except the one about no offset of 1 in line 112, not sure yet if I'll try to catch that).

Offline shadowballs

  • BeBot Rookie
  • *
  • Posts: 6
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #159 on: March 28, 2007, 01:40:23 pm »
Ive downloaded the updated update script from the first page and yes, it works better now.

I'm still getting that "PHP Notice:  Undefined offset:" 1 in line 112 though BUT!
Code: [Select]
================================================
10 http queries for org information done!
15 total http queries done!
3115 entries in database associated with an org modified!
3119 entries in database modified!
3120 entries in the whois cache!
2min 9sec runtime for org updates!
2min 13sec total runtime!
================================================

Code: [Select]
================================================
10 http queries for org information done!
15 total http queries done!
3115 entries in database associated with an org modified!
3119 entries in database modified!
3120 entries in the whois cache!
1min 16sec runtime for org updates!
1min 19sec total runtime!
================================================

First one is from the old script that spammed me all those messages, last one is the new script that only gives me that offset of 1 in 112 message.

notice any diffrence?  ;D

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #160 on: March 28, 2007, 01:50:33 pm »
It runs faster :)

Which could just be due to less delay for the output though.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #161 on: March 28, 2007, 04:35:15 pm »
Keep in mind that I don't know what the code is. If someone can post the relevant lines (ie 105-115 I might be able to debug it. ;)

Edit: Tyop
« Last Edit: March 28, 2007, 04:39:19 pm by Blueeagle »
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #162 on: March 28, 2007, 04:46:22 pm »
Code: [Select]
function xmlparse($xml, $tag)
{
$tmp = explode("<" . $tag . ">", $xml);
$tmp = explode("</" . $tag . ">", $tmp[1]);
return $tmp[0];
}
It's the $tmp[1] here, which prolly creates an notice if $tag doesn't exist in the $xml var. Adding a simple check like the following may perhaps solve the notice without breaking anything:
Code: [Select]
function xmlparse($xml, $tag)
{
$tmp = explode("<" . $tag . ">", $xml);
if (!(isset($tmp[1])))
return "";
$tmp = explode("</" . $tag . ">", $tmp[1]);
return $tmp[0];
}

EDIT: Those two functions are direct copies from the Bot class btw, that should create the same notices then too.
« Last Edit: March 28, 2007, 04:48:11 pm by Alreadythere »

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #163 on: March 30, 2007, 01:19:48 pm »
Updated the whois-update.php file in first post.
  • Added workaround for the notice in the xmlparse() function
  • updating pictureurl now too, no idea why I forgot that
  • optimized handling of org members a bit

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Persistent Whois cache with out-of-bot upgrading
« Reply #164 on: March 31, 2007, 09:17:44 am »
Alreadythere,

Line 6 of the individual character DB update should be:

. "', org_rank_id='" .$who["rank_id"]. "', updated='" .$thistime. "', pictureurl='" .$who["pictureurl"]. "' WHERE nickname='" .$who["nick"]. "';";

(Delete line 7).

Explode for org only should be:

$who["pictureurl"] = xmlparse($content, "photo_url");

I think anyway :-)

-jj-

 

* Recent Posts
0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm ]

* Who's Online
  • Dot Guests: 285
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal