Permalink
Browse files

removing the use of serialized objects

  • Loading branch information...
padams
padams committed Feb 24, 2014
1 parent 776e168 commit 4ca8a181857a9257ca50d236863b9e81fd7a80a8
Showing with 20 additions and 14 deletions.
  1. +12 −10 modules/base/classes/httpEventQueue.php
  2. +8 −4 queue.php
@@ -47,13 +47,12 @@ function __construct( $map = array() ) {
function sendMessage( $event ) {
if ($event) {
$properties['owa_event'] = base64_encode(serialize($event));
if ( $event ) {
$properties = array();
$properties['owa_event'] = $event->export();
//$properties = array_map('urlencode', $properties);
$properties = owa_lib::implode_assoc('=', '&', $properties);
//print_r($properties);
//return;
} else {
return;
}
@@ -65,16 +64,19 @@ function sendMessage( $event ) {
if (!$fp) {
return false;
} else {
$content = http_build_query( $properties );
$out = "POST ".$parts['path']." HTTP/1.1\r\n";
$out.= "Host: ".$parts['host']."\r\n";
$out.= "Content-Type: application/x-www-form-urlencoded\r\n";
$out.= "Content-Length: ".strlen($properties)."\r\n";
$out.= "Content-Length: ".strlen( $content )."\r\n";
$out.= "Connection: Close\r\n\r\n";
$out.= $properties;
owa_coreAPI::debug("out: $out");
$out.= $content;
fwrite($fp, $out);
fclose($fp);
owa_coreAPI::debug("out: $out");
return true;
}
}
@@ -35,16 +35,20 @@
*/
$owa = new owa_php();
if ( $owa->isEndpointEnabled( basename( __FILE__ ) ) ) {
if ( $owa->isEndpointEnabled( basename( __FILE__ ) ) ) {
$owa->setSetting('base', 'is_remote_event_queue', true);
$owa->e->debug($_POST);
$owa->e->debug('post: ' . print_r($_POST, true) );
$raw_event = owa_coreAPI::getRequestParam('event');
if ( $raw_event ) {
$dispatch = owa_coreAPI::getEventDispatch();
$event = unserialize( base64_decode( $raw_event ) );
$event = $dispatch->makeEvent();
$event->loadFromArray($raw_event);
$owa->e->debug(print_r($event,true));
$dispatch->asyncNotify($event);
}

0 comments on commit 4ca8a18

Please sign in to comment.