mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-22 05:49:03 +01:00
Add copyobj() function for php5 object cloning vs php3/4 copies, fix _debug_array() for php5
This commit is contained in:
parent
7d999cd13c
commit
e07e330732
@ -805,6 +805,29 @@
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
@function copyobj
|
||||
@abstract duplicates the result of copying an object under php3/4 even when using php5
|
||||
@author milosch
|
||||
@discussion This is critical when looping on db object output and updating or inserting to the database using a copy of the db object. This was first added to GroupWhere
|
||||
@syntax copyobj($source_object,$target_object);
|
||||
@example copyobj($GLOBALS['phpgw']->db,$mydb);
|
||||
@param $a - Source Object
|
||||
@param $b - Target Object (copy)
|
||||
*/
|
||||
function copyobj($a,&$b)
|
||||
{
|
||||
if(floor(phpversion()) > 4)
|
||||
{
|
||||
$b = $a->__clone();
|
||||
}
|
||||
else
|
||||
{
|
||||
$b = $a;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*!
|
||||
@function get_account_id
|
||||
@abstract Return a properly formatted account_id.
|
||||
@ -867,7 +890,7 @@
|
||||
function _debug_array($array,$print=True)
|
||||
{
|
||||
$four = False;
|
||||
if(@floor(phpversion()) == 4)
|
||||
if(@floor(phpversion()) > 3)
|
||||
{
|
||||
$four = True;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user