$explicitTypeField = AmfphpFlexMessaging::FLEX_TYPE_ACKNOWLEDGE_MESSAGE; $this->correlationId = $correlationId; $this->messageId = $this->generateRandomId(); $this->clientId = $this->generateRandomId(); $this->destination = null; $this->body = null; $this->timeToLive = 0; $this->timestamp = (int) (time() . '00'); $this->headers = new stdClass(); } /** * generate random id * @return string */ public function generateRandomId() { // version 4 UUID return sprintf( '%08X-%04X-%04X-%02X%02X-%012X', mt_rand(), mt_rand(0, 65535), bindec(substr_replace( sprintf('%016b', mt_rand(0, 65535)), '0100', 11, 4) ), bindec(substr_replace(sprintf('%08b', mt_rand(0, 255)), '01', 5, 2)), mt_rand(0, 255), mt_rand() ); } } ?>