cvs: pear /Net_DNS/DNS Packet.php RR.php

From: Date: Sat, 09 Apr 2005 09:41:14 +0000
Subject: cvs: pear /Net_DNS/DNS Packet.php RR.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-31076@lists.php.net to get a copy of this message
cox Sat Apr 9 05:41:14 2005 EDT Modified files: /pear/Net_DNS/DNS Packet.php RR.php Log: renamed Net_DNS_RR::getRR() to factory() http://cvs.php.net/diff.php/pear/Net_DNS/DNS/Packet.php?r1=1.18&r2=1.19&ty=u Index: pear/Net_DNS/DNS/Packet.php diff -u pear/Net_DNS/DNS/Packet.php:1.18 pear/Net_DNS/DNS/Packet.php:1.19 --- pear/Net_DNS/DNS/Packet.php:1.18 Fri Apr 8 12:13:20 2005 +++ pear/Net_DNS/DNS/Packet.php Sat Apr 9 05:41:11 2005 @@ -562,7 +562,7 @@ return(array(NULL, NULL)); } - $rrobj = Net_DNS_RR::getRR(array($name, + $rrobj = &Net_DNS_RR::factory(array($name, $type, $class, $ttl, http://cvs.php.net/diff.php/pear/Net_DNS/DNS/RR.php?r1=1.14&r2=1.15&ty=u Index: pear/Net_DNS/DNS/RR.php diff -u pear/Net_DNS/DNS/RR.php:1.14 pear/Net_DNS/DNS/RR.php:1.15 --- pear/Net_DNS/DNS/RR.php:1.14 Fri Apr 8 12:13:21 2005 +++ pear/Net_DNS/DNS/RR.php Sat Apr 9 05:41:11 2005 @@ -55,26 +55,35 @@ /* }}} */ /* - * I finally did it... i pass an array to the function - * instead of a parameter list... UGH... i hate perl... + * Use Net_DNS_RR::factory() instead + * + * @access private */ /* class constructor - Net_DNS_RR($rrdata) {{{ */ function Net_DNS_RR($rrdata) { if ($rrdata != 'getRR') { //BC check/warning remove later - trigger_error("Please use Net_DNS_RR::getRR() instead"); + trigger_error("Please use Net_DNS_RR::factory() instead"); } } - function getRR($rrdata) + /* + * Returns an RR object, use this instead of constructor + * + * @param mixed $rr_rdata Options as string, array or data + * @return object Net_DNS_RR or Net_DNS_RR_<type> + * @access public + * @see Net_DNS_RR::new_from_array Net_DNS_RR::new_from_data Net_DNS_RR::new_from_string + */ + function &factory($rrdata) { if (is_string($rrdata)) { - $rr = Net_DNS_RR::new_from_string($rrdata); + $rr = &Net_DNS_RR::new_from_string($rrdata); } elseif (count($rrdata) == 7) { list($name, $rrtype, $rrclass, $ttl, $rdlength, $data, $offset) = $rrdata; - $rr = Net_DNS_RR::new_from_data($name, $rrtype, $rrclass, $ttl, $rdlength, $data, $offset); + $rr = &Net_DNS_RR::new_from_data($name, $rrtype, $rrclass, $ttl, $rdlength, $data, $offset); } else { - $rr = Net_DNS_RR::new_from_array($rrdata); + $rr = &Net_DNS_RR::new_from_array($rrdata); } return $rr; }

« previous php.pear.cvs (#31076) next »