Added Debugging Code and Changed the UserAgent

This commit is contained in:
Erik Kristensen 2005-07-16 18:45:36 +00:00
parent 8b22314b84
commit ed3cf51ee4

View File

@ -49,7 +49,8 @@
class updatedns {
var $_changeFile = '/var/etc/dyndns.cache';
var $_UserAgent = 'User-Agent: php-dns-updater/0.4';
var $_debugFile = '/var/etc/dyndns.debug';
var $_UserAgent = 'User-Agent: phpDynDNS/0.4';
var $_errorVerbosity = 0;
var $_dnsService;
var $_dnsUser;
@ -184,6 +185,7 @@
$status = "phpDynDNS: (Success) No Change In IP Address";
} else {
$status = "phpDynDNS: (Unknown Response)";
$this->_debug($data);
}
break;
case 'dhs':
@ -400,6 +402,15 @@
}
}
function _debug ($data) {
$string = date('m-d-y h:i:s').' - ['.$this->dnsService.'] - '.$data.'\n';
$file = fopen($this->_debugFile, 'a');
fwrite($file, $string);
fclose($file);
}
}
?>