2 require (dirname(__FILE__
) . "/../sql.inc");
9 function DataObjectBase($xuser) {
10 $this->xmlrpcerruser
= $xuser;
11 $this->_func_map
=array();
14 function _handleError($err) {
16 return new xmlrpcresp(0, $this->xmlrpcerruser
, $err);
20 function _addFunc($func,$mapping) {
21 if (isset($this->_func_map
[$func])) {
22 $trace = debug_backtrace();
23 trigger_error("Function <b>$func</b> already exists in function map in <b>" . $trace[0]['file'] . "</b> on line <b>" . $trace[0]['line'] . "</b>", E_USER_WARNING
);
25 elseif (is_callable(array($this,$func))) {
26 $this->_func_map
[$func] = $mapping;
30 $trace = debug_backtrace();
31 trigger_error("Cannot add a function <b>$func</b> to function map which is not callable in <b>" . $trace[0]['file'] . "</b> on line <b>" . $trace[0]['line'] . "</b>", E_USER_ERROR
);
36 function _isodate ($date) {
38 $format_iso = 'Ymd\TH:i:sO';
39 $format_iso_utc = 'Ymd\TH:i:s';
41 $dt = split("-",$date);
43 $dt_stamp = $this->_ctime(0,0,0,$dt[1],$dt[2],$dt[0]);
45 return gmdate($format_iso_utc, $dt_stamp);
50 $objArgs = func_get_args();
51 $nCount = count($objArgs);
56 $objArgs[] = $objDate["hours"];
58 $objArgs[] = $objDate["minutes"];
60 $objArgs[] = $objDate["seconds"];
62 $objArgs[] = $objDate["mon"];
64 $objArgs[] = $objDate["mday"];
66 $objArgs[] = $objDate["year"];
76 else if ($nYear < 1952)
78 $nOffset = -2650838400;
80 // Apparently dates before 1942 were never DST
86 $nOffset = -883612800;
91 return call_user_func_array("mktime", $objArgs) +
$nOffset;