View Single Post
Old 08-25-2008, 02:12 PM   #2 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Thanks, I wrote something similar not long ago for a guild website i was developing. In my case I used armory to populate the guild roster in the DB.

One thing i did notice about your code:
PHP Code:
$url_string curl_exec($ch); 
return 
simplexml_load_string($url_string); 
     
curl_close($ch); 
The curl_close is defined after the return, thus it is never fired and resources never freed.

This is the correct code:
PHP Code:
$url_string curl_exec($ch); 
curl_close($ch); 

return 
simplexml_load_string($url_string); 
Also
PHP Code:
curl_setopt ($chCURLOPT_USERAGENT,  armory::BROWSER); 
may aswell be:
PHP Code:
curl_setopt ($chCURLOPT_USERAGENT,  self::BROWSER); 
Just in case you wish to change the name of your class.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
The Following User Says Thank You to sketchMedia For This Useful Post:
Mithadriel (11-08-2008)