phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] email/inc class.mail_dcom_pop3_sock.inc.php, 1.22 cla


From: powerstat
Subject: [Phpgroupware-cvs] email/inc class.mail_dcom_pop3_sock.inc.php, 1.22 class.mail_dcom_nntp_sock.inc.php, 1.7 class.mail_dcom_base_sock.inc.php, 1.27
Date: Thu, 5 May 2005 19:48:00 +0200

Update of email/inc

Modified Files:
     Branch: MAIN
            class.mail_dcom_pop3_sock.inc.php lines: +36 -36
            class.mail_dcom_nntp_sock.inc.php lines: +5 -5
            class.mail_dcom_base_sock.inc.php lines: +3 -3

Log Message:
Fixes deprecated (since 2003) call by reference functions calls. Some function 
declarations have been changed for call by reference

====================================================
Index: email/inc/class.mail_dcom_pop3_sock.inc.php
diff -u email/inc/class.mail_dcom_pop3_sock.inc.php:1.21 
email/inc/class.mail_dcom_pop3_sock.inc.php:1.22
--- email/inc/class.mail_dcom_pop3_sock.inc.php:1.21    Sun Mar 13 23:22:44 2005
+++ email/inc/class.mail_dcom_pop3_sock.inc.php Thu May  5 17:48:10 2005
@@ -187,7 +187,7 @@
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
                        $this->read_port();
-                       if(!$this->msg2socket('USER '.$user,"^\+ok",&$response) 
|| !$this->msg2socket('PASS '.$pass,"^\+ok",&$response))
+                       if(!$this->msg2socket('USER '.$user,"^\+ok",$response) 
|| !$this->msg2socket('PASS '.$pass,"^\+ok",$response))
                        {
                                $this->error();
                                if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving open with Error<br />'; }
@@ -214,7 +214,7 @@
                */
                function close($flags='')
                {
-                       if (!$this->msg2socket('QUIT',"^\+ok",&$response))
+                       if (!$this->msg2socket('QUIT',"^\+ok",$response))
                        {
                                $this->error();
                                if ($this->debug_dcom >= 1) { echo 'pop3: 
close: Error<br />'; }
@@ -263,7 +263,7 @@
                        // 1)  number of messages
                        // 2) total size of mailbox
                        // imap_mailboxmsginfo is the only function to return 
both of these
-                       if (!$this->msg2socket('STAT',"^\+ok",&$response))
+                       if (!$this->msg2socket('STAT',"^\+ok",$response))
                        {
                                $this->error();
                                return False;
@@ -401,7 +401,7 @@
                                case SORTARRIVAL:
                                        if ($this->debug_dcom >= 1) { echo 
'pop3: sort: case SORTARRIVAL<br />'; }
                                        // TEST
-                                       if 
(!$this->msg2socket('LIST',"^\+ok",&$response))
+                                       if 
(!$this->msg2socket('LIST',"^\+ok",$response))
                                        {
                                                $this->error();
                                        }
@@ -573,7 +573,7 @@
                        // if we have an "old school" very simple email, there 
will be NO 1st level of subparts
                        // in that case the only body that exists is considered 
part #1
                        // NOTE: param to  create_embeded_fetchstructure  is a 
REFERENCE
-                       
$this->create_embeded_fetchstructure(&$this->msg_structure);
+                       
$this->create_embeded_fetchstructure($this->msg_structure);

                        // if there are subparts, we need to discover the 
details of those parts now
                        // FOUR PASS ANALYSIS
@@ -585,7 +585,7 @@
                                        if ($this->debug_dcom >= 2) { echo '<br 
/>***<br />* * * * * * * * *<br />pop3: fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.'] of 
['.(string)(count($this->msg_structure->parts)-1).'] embedded parts discovery * 
* * * *<br />'; }
                                        // Create Sub-Parts FetchStructure Data 
 (if necessary)  ---
                                        // NOTE: param to  
create_embeded_fetchstructure  is a REFERENCE
-                                       
$this->create_embeded_fetchstructure(&$this->msg_structure->parts[$lev_1]);
+                                       
$this->create_embeded_fetchstructure($this->msg_structure->parts[$lev_1]);

                                        // go deeper
                                        $tmp_lev_1 = 
$this->msg_structure->parts[$lev_1];
@@ -597,7 +597,7 @@
                                                        if ($this->debug_dcom 
>= 2) { echo '<br />***<br />* * * * * * * * *<br />pop3: fetchstructure: 
attempting this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.'] of 
['.(string)(count($tmp_lev_1->parts)-1).'] embedded parts discovery * * * * 
*<br />'; }
                                                        // Create Sub-Parts 
FetchStructure Data  (if necessary)  ---
                                                        // NOTE: param to  
create_embeded_fetchstructure  is a REFERENCE
-                                                       
$this->create_embeded_fetchstructure(&$tmp_lev_1->parts[$lev_2]);
+                                                       
$this->create_embeded_fetchstructure($tmp_lev_1->parts[$lev_2]);

                                                        // go deeper
                                                        $tmp_lev_2 = 
$tmp_lev_1->parts[$lev_2];
@@ -609,7 +609,7 @@
                                                                        if 
($this->debug_dcom >= 2) { echo '<br />***<br />* * * * * * * * *<br />pop3: 
fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.']->parts['.$lev_3.'] of 
['.(string)(count($tmp_lev_2->parts)-1).'] embedded parts discovery * * * * 
*<br />'; }
                                                                        // 
Create 3rd Level Sub-Parts FetchStructure Data  (if necessary)  ---
                                                                        // 
NOTE: param to  create_embeded_fetchstructure  is a REFERENCE
-                                                                       
$this->create_embeded_fetchstructure(&$tmp_lev_2->parts[$lev_3]);
+                                                                       
$this->create_embeded_fetchstructure($tmp_lev_2->parts[$lev_3]);

                                                                        // go 
deeper
                                                                        
$tmp_lev_3 = $tmp_lev_2->parts[$lev_3];
@@ -621,7 +621,7 @@
                                                                                
        if ($this->debug_dcom >= 2) { echo '<br />***<br />* * * * * * * * *<br 
/>pop3: fetchstructure: attempting 
this->msg_structure->parts['.$lev_1.']->parts['.$lev_2.']->parts['.$lev_3.']->parts['.$lev_4.']
 of ['.(string)(count($tmp_lev_3->parts)-1).'] embedded parts discovery * * * * 
*<br />'; }
                                                                                
        // Create Sub-Parts FetchStructure Data  (if necessary)  ---
                                                                                
        // NOTE: param to  create_embeded_fetchstructure  is a REFERENCE
-                                                                               
        $this->create_embeded_fetchstructure(&$tmp_lev_3->parts[$lev_4]);
+                                                                               
        $this->create_embeded_fetchstructure($tmp_lev_3->parts[$lev_4]);
                                                                                
}
                                                                        }
                                                                        else
@@ -725,11 +725,11 @@
                        $this->msg_structure->custom['detect_state'] = 'out'; 
// not doing multi part detection on this yet
                        // ---  Fill  Top Level Fetchstructure  ---
                        // NOTE: first param to sub_get_structure is a REFERENCE
-                       
$this->sub_get_structure(&$this->msg_structure,$header_array);
+                       
$this->sub_get_structure($this->msg_structure,$header_array);

                        // ---  Fill Any Missing Necessary Data  ---
                        // --Bytes-- top level msg Size (bytes) is obtainable 
from the server
-                       if (!$this->msg2socket('LIST 
'.$msg_num,"^\+ok",&$response))
+                       if (!$this->msg2socket('LIST 
'.$msg_num,"^\+ok",$response))
                        {
                                $this->error();
                                if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving fill_toplevel_fetchstructure with error<br />'; }
@@ -768,7 +768,7 @@
                        }
                        // unset any elements that have not been filled
                        // NOTE: param to  unset_unfilled_fetchstructure  is a 
REFERENCE
-                       
$this->unset_unfilled_fetchstructure(&$this->msg_structure);
+                       
$this->unset_unfilled_fetchstructure($this->msg_structure);
                        if ($this->debug_dcom >= 2)
                        {
                                echo '<br />dumping 
fill_toplevel_fetchstructure TOP-LEVEL data: <br />';
@@ -788,7 +788,7 @@
                @author Angles
                @access private
                */
-               function create_embeded_fetchstructure($info)
+               function create_embeded_fetchstructure(&$info)
                {
                        if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
create_embeded_fetchstructure<br />'; }
                        // --- Do We Have SubParts To Discover  ---
@@ -855,7 +855,7 @@
                                                        // we are DONE with 
this part for now
                                                        // unset any unfilled 
elements
                                                        // NOTE: param to  
unset_unfilled_fetchstructure  is a REFERENCE
-                                                       
$this->unset_unfilled_fetchstructure(&$tmp_cur_part_idx);
+                                                       
$this->unset_unfilled_fetchstructure($tmp_cur_part_idx);
                                                        
$info->parts[$cur_part_idx] = $tmp_cur_part_idx;
                                                        
unset($tmp_cur_part_idx);
                                                }
@@ -909,7 +909,7 @@
                                                
$tmp_new_part_idx->custom['part_start'] = (int)($y+1);
                                                // fill the conventional info 
on this fetchstructure sub-part
                                                // NOTE: first param to 
sub_get_structure is a REFERENCE
-                                               
$this->sub_get_structure(&$tmp_new_part_idx,$part_header_array);
+                                               
$this->sub_get_structure($tmp_new_part_idx,$part_header_array);
                                                $info->parts[$new_part_idx] = 
$tmp_new_part_idx;
                                                unset($tmp_new_part_idx);

@@ -934,7 +934,7 @@
                                                if ($this->debug_dcom >= 2) { 
echo 'pop3: create_embeded_fetchstructure: mime loop: final boundary at 
['.(string)($x-1).'] byte cumula: ['.$tmp_cur_part_idx->bytes.'] lines: 
['.$tmp_cur_part_idx->lines.']<br />'; }
                                                // unset any unfilled elements
                                                // NOTE: param to  
unset_unfilled_fetchstructure  is a REFERENCE
-                                               
$this->unset_unfilled_fetchstructure(&$tmp_cur_part_idx);
+                                               
$this->unset_unfilled_fetchstructure($tmp_cur_part_idx);
                                                $info->parts[$cur_part_idx] = 
$tmp_cur_part_idx;
                                                unset($tmp_cur_part_idx);
                                        }
@@ -1032,7 +1032,7 @@
                                // 2) Feed these Headers thru 
"sub_get_structure"
                                // fill the conventional info on this 
fetchstructure sub-part
                                // NOTE: first param to sub_get_structure is a 
REFERENCE
-                               
$this->sub_get_structure(&$tmp_enc_part_idx,$part_header_array);
+                               
$this->sub_get_structure($tmp_enc_part_idx,$part_header_array);

                                // ==  CONTROVESTIAL DEFAULT UWASH VALUE 
ASSIGNMENTS  ==
                                // close study of UWash IMAP indicates the an 
immediate child message part of a RFC822 package will:
@@ -1158,7 +1158,7 @@
                @author Angles, Itzchak Rehberg, Joseph Engo
                @access private
                */
-               function sub_get_structure($info,$header_array)
+               function sub_get_structure(&$info,$header_array)
                {
                        // set debug flag
                        if ($this->debug_dcom >= 2)
@@ -1205,7 +1205,7 @@
                                  case 'content-type:' :
                                        // this will fill type and (hopefully) 
subtype
                                        // NOTE: first param to  
parse_type_subtype  is a REFERENCE
-                                       
$this->parse_type_subtype(&$info,$content);
+                                       
$this->parse_type_subtype($info,$content);
                                        // ALSO, typically Paramaters are on 
this line as well
                                        $pos_param = strpos($content,';');
                                        if ($pos_param > 0)
@@ -1216,7 +1216,7 @@
                                                if ($this->debug_dcom >= 2) { 
echo 'pop3: sub_get_structure: calling parse_msg_params, feeding content 
['.$content.']<br />'; }
                                                // False = this is NOT a 
disposition param, this is the more common regular param
                                                // NOTE: first param to  
parse_msg_params  is a REFERENCE
-                                               
$this->parse_msg_params(&$info,$content,False);
+                                               
$this->parse_msg_params($info,$content,False);
                                        }
                                        break;
                                  case 'content-transfer-encoding:' :
@@ -1242,7 +1242,7 @@
                                                // feed the whole param line 
into this function
                                                $content = 
substr($content,$pos_param+1);
                                                // NOTE: first param to  
parse_msg_params  is a REFERENCE
-                                               
$this->parse_msg_params(&$info,$content,False);
+                                               
$this->parse_msg_params($info,$content,False);
                                        }
                                        break;
                                  case 'content-identifier:' :
@@ -1299,7 +1299,7 @@
                @author Angles
                @access private
                */
-               function unset_unfilled_fetchstructure($info)
+               function unset_unfilled_fetchstructure(&$info)
                {
                        if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
unset_unfilled_fetchstructure<br />'; }
                        // unset any unfilled elements, ALWAYS leave parts and 
custom
@@ -1375,7 +1375,7 @@
                @author Angles, Itzchak Rehberg, Joseph Engo
                @access private
                */
-               function parse_type_subtype($info,$content)
+               function parse_type_subtype(&$info,$content)
                {
                        if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
parse_type_subtype<br />'; }
                        // used by pop_fetchstructure only
@@ -1428,7 +1428,7 @@
                @author Angles, Itzchak Rehberg, Joseph Engo
                @access private
                */
-               function 
parse_msg_params($info,$content,$is_disposition_param=False)
+               function 
parse_msg_params(&$info,$content,$is_disposition_param=False)
                {
                        if ($this->debug_dcom >= 2) {
                                //echo 'pop3: *in parse_msg_params<br />';
@@ -1602,7 +1602,7 @@
                function size_msg($stream_notused,$msg_num)
                {
                        if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
size_msg<br />'; }
-                       if (!$this->msg2socket('LIST 
'.$msg_num,"^\+ok",&$response))
+                       if (!$this->msg2socket('LIST 
'.$msg_num,"^\+ok",$response))
                        {
                                $this->error();
                                return False;
@@ -1692,37 +1692,37 @@
                                        case 'to:'      :
                                          // following two lines need to be put 
into a loop!
                                          // NOTE: 3rd and 4th params to  
get_addr_details  are REFERENCES
-                                         $info->to   = 
$this->get_addr_details('to',$content,&$header_array,&$i);
+                                         $info->to   = 
$this->get_addr_details('to',$content,$header_array,$i);
                                          break;
                                        case 'from'     :
                                        case 'from:'    :
                                          // NOTE: 3rd and 4th params to  
get_addr_details  are REFERENCES
-                                         $info->from = 
$this->get_addr_details('from',$content,&$header_array,&$i);
+                                         $info->from = 
$this->get_addr_details('from',$content,$header_array,$i);
                                          break;
                                        case 'cc'       :
                                        case 'cc:'      :
                                          // NOTE: 3rd and 4th params to  
get_addr_details  are REFERENCES
-                                         $info->cc   = 
$this->get_addr_details('cc',$content,&$header_array,&$i);
+                                         $info->cc   = 
$this->get_addr_details('cc',$content,$header_array,$i);
                                          break;
                                        case 'bcc'      :
                                        case 'bcc:'     :
                                          // NOTE: 3rd and 4th params to  
get_addr_details  are REFERENCES
-                                         $info->bcc  = 
$this->get_addr_details('bcc',$content,&$header_array,&$i);
+                                         $info->bcc  = 
$this->get_addr_details('bcc',$content,$header_array,$i);
                                          break;
                                        case 'reply-to' :
                                        case 'reply-to:'        :
                                          // NOTE: 3rd and 4th params to  
get_addr_details  are REFERENCES
-                                         $info->reply_to = 
$this->get_addr_details('reply_to',$content,&$header_array,&$i);
+                                         $info->reply_to = 
$this->get_addr_details('reply_to',$content,$header_array,$i);
                                          break;
                                        case 'sender'   :
                                        case 'sender:'  :
                                          // NOTE: 3rd and 4th params to  
get_addr_details  are REFERENCES
-                                         $info->sender = 
$this->get_addr_details('sender',$content,&$header_array,&$i);
+                                         $info->sender = 
$this->get_addr_details('sender',$content,$header_array,$i);
                                          break;
                                        case 'return-path'      :
                                        case 'return-path:'     :
                                          // NOTE: 3rd and 4th params to  
get_addr_details  are REFERENCES
-                                         $info->return_path = 
$this->get_addr_details('return_path',$content,&$header_array,&$i);
+                                         $info->return_path = 
$this->get_addr_details('return_path',$content,$header_array,$i);
                                          break;
                                        default :
                                          break;
@@ -1746,7 +1746,7 @@
                @author Itzchak Rehberg, Joseph Engo
                @access private
                */
-               function get_addr_details($people,$address,$header,$count)
+               function get_addr_details($people,$address,&$header,&$count)
                {
                        if ($this->debug_dcom >= 1) { echo 'pop3: Entering 
get_addr_details<br />'; }
                        if (!trim($address))
@@ -1930,7 +1930,7 @@
                        {
                                $this_msg_num = $msg_num_array[$i];
                                if ($this->debug_dcom >= 2) { echo 'pop3: 
delete: deleting this_msg_num '.$this_msg_num.'<br />'; }
-                               if (!$this->msg2socket('DELE 
'.$this_msg_num,"^\+ok",&$response))
+                               if (!$this->msg2socket('DELE 
'.$this_msg_num,"^\+ok",$response))
                                {
                                        $this->error();
                                        if ($this->debug_dcom >= 1) { echo 
'pop3: Leaving delete with error deleting msgnum '.$this_msg_num.'<br />'; }
@@ -2048,7 +2048,7 @@
                        }
                        // NO cached data, get it
                        if ($this->debug_dcom >= 1) { echo 'pop3: 
get_header_raw: issuing: TOP '.$msg_num.' 0 <br />'; }
-                       if (!$this->msg2socket('TOP '.$msg_num.' 
0',"^\+ok",&$response))
+                       if (!$this->msg2socket('TOP '.$msg_num.' 
0',"^\+ok",$response))
                        {
                                $this->error();
                                if ($this->debug_dcom >= 1) { echo 'pop3: 
Leaving get_header_raw with error<br />'; }
@@ -2237,7 +2237,7 @@
                                if ($this->debug_dcom >= 1) { echo 'pop3: 
get_body: NO Cached Data<br />'; }
                                // NO cached data we can use
                                // issue command to retrieve body
-                               if (!$this->msg2socket('RETR 
'.$msg_num,"^\+ok",&$response))
+                               if (!$this->msg2socket('RETR 
'.$msg_num,"^\+ok",$response))
                                {
                                        $this->error();
                                        if ($this->debug_dcom >= 1) { echo 
'pop3: Leaving get_body with error<br />'; }

====================================================
Index: email/inc/class.mail_dcom_nntp_sock.inc.php
diff -u email/inc/class.mail_dcom_nntp_sock.inc.php:1.6 
email/inc/class.mail_dcom_nntp_sock.inc.php:1.7
--- email/inc/class.mail_dcom_nntp_sock.inc.php:1.6     Sun Mar 13 23:22:44 2005
+++ email/inc/class.mail_dcom_nntp_sock.inc.php Thu May  5 17:48:10 2005
@@ -30,7 +30,7 @@

        function mode_reader()
        {
-               return $this->msg2socket('mode reader','^20[01]',&$response);
+               return $this->msg2socket('mode reader','^20[01]',$response);
        }

        function login ($user,$passwd,$server,$port,$folder = '')
@@ -57,11 +57,11 @@

                if ($user <> '' && $passwd <> '')
                {
-                       if (!$this->msg2socket('authinfo user 
'.$user,'^381',&$response))
+                       if (!$this->msg2socket('authinfo user 
'.$user,'^381',$response))
                        {
                                $this->error();
                        }
-                       if (!$this->msg2socket('authinfo pass 
'.$passwd,'^281',&$response))
+                       if (!$this->msg2socket('authinfo pass 
'.$passwd,'^281',$response))
                        {
                                $this->error();
                        }
@@ -140,7 +140,7 @@
        function get_mailbox_counts($folder='',$index=1)
        {
                $mailbox = $this->fix_folder($folder);
-               if (!$this->msg2socket('group '.$mailbox,'^211',&$response))
+               if (!$this->msg2socket('group '.$mailbox,'^211',$response))
                {
                        $this->error();
                }
@@ -224,7 +224,7 @@

        function fetch_field($start,$stop,$element)
        {
-               if (!$this->msg2socket('XHDR '.$element.' 
'.$start.'-'.$stop,'^221',&$response))
+               if (!$this->msg2socket('XHDR '.$element.' 
'.$start.'-'.$stop,'^221',$response))
                {
                        $this->error();
                }

====================================================
Index: email/inc/class.mail_dcom_base_sock.inc.php
diff -u email/inc/class.mail_dcom_base_sock.inc.php:1.26 
email/inc/class.mail_dcom_base_sock.inc.php:1.27
--- email/inc/class.mail_dcom_base_sock.inc.php:1.26    Sun Mar 13 23:22:44 2005
+++ email/inc/class.mail_dcom_base_sock.inc.php Thu May  5 17:48:10 2005
@@ -627,7 +627,7 @@
                @abstract ?
                @author unknown, maybe Skeeter ? Rehberg ? Engo ?
                */
-               function create_header($line,$header,$line2='')
+               function create_header($line,&$header,$line2='')
                {
                        $thead = explode(':',$line);
                        $key = trim($thead[0]);
@@ -678,7 +678,7 @@
                        $temp_array = explode(';',$this->header[$key]);
                        for ($i=0;$i<count($temp_array);$i++)
                        {
-                               
$this->decode_author($temp_array[$i],&$email,&$name);
+                               
$this->decode_author($temp_array[$i],$email,$name);
                                $temp = explode('@',$email);
                                $address[$i]->personal = 
$this->decode_header($name);
                                $address[$i]->mailbox = $temp[0];
@@ -967,7 +967,7 @@
                        {
                                //echo $line."<br />\n";
                                if (chop($line) == $end) break;
-                               
$this->create_header($line,&$this->header,"True");
+                               
$this->create_header($line,$this->header,"True");
                        }
                        return 1;
                }






reply via email to

[Prev in Thread] Current Thread [Next in Thread]