getCache($endpoint); // try find in cache if ( $in["mmode"] == 0 ){ $this->deleteCache($endpoint); $this->saveCache($endpoint,$in,1300); } else { $outC = $this->getCache($endpoint); // try find in cache $outArr = $outC; // unserialize( $outC ); log_message('critical', "CACHE READ ***** WrenchUserContacts::usersContacts() ----**> ".$outArr["raw_contacts"]); $in["raw_contacts"] = $in["raw_contacts"].$outC["raw_contacts"]; $this->deleteCache($endpoint); $this->saveCache($endpoint,$in,5300); /* Determine if this is the last Fire process events save to the backend database; */ if ($in["csize"] + $in["mmode"] >= $in["pcount"]){ $time_to_save = true; } } ///=== cache game gere if($time_to_save){ $in["raw_contacts"] = serialize($in['raw_contacts']); $ret = $this->wrenchboard->wrenchboard_api($in, $out); $out['internal_return'] = $ret; } else{ $out["status_msg"] = "Received and cached"; } // log_message('critical', "*********** WrenchUserContacts::usersContacts() 0001 ".serialize($out) ); return $this->summaryReturnData($in,$out); //json_encode( $final_out ); } private function processContacts( $in ){ log_message('critical', "************************ cachecontacts 0001 ".serialize($in)); $inx =[]; $inx["member_id"] = $in["member_id"]; $inx["uid"] = $in["uid"]; $inx["sessionid"] = $in["sessionid"]; $raw_contacts = $in["raw_contacts"]; foreach ( $raw_contacts["contacts"] as $rows){ $firstname = $rows["name"]["given"]; $lastname = $rows["name"]["family"]; $contactid = $rows["contactId"]; log_message('critical', "************************ $firstname $lastname $contactid"); } } }