Skip to content

Commit

Permalink
Change detailed history tests to retrieve only 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
geremy cohen committed Sep 4, 2012
1 parent 1420866 commit 4efff43
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 26 deletions.
4 changes: 0 additions & 4 deletions php/3.3/Pubnub.php
Expand Up @@ -237,24 +237,20 @@ public function decodeAndDecrypt($messages, $mode = "default")
{
$receivedMessages = array();


if ($mode == "presence") {
return $messages;

} elseif ($mode == "default") {

$messageArray = $messages;
$receivedMessages = $this->decodeDecryptLoop($messageArray);

} elseif ($mode == "detailedHistory") {

$messageArray = $messages[0];
$receivedMessages = $this->decodeDecryptLoop($messageArray);

}

return $receivedMessages;

}

public function decodeDecryptLoop($messageArray)
Expand Down
22 changes: 11 additions & 11 deletions php/3.3/pubnubCipherTextTests.php
Expand Up @@ -109,7 +109,7 @@
echo "Running detailedHistory\r\n";
$history = $pubnub->detailedHistory(array(
'channel' => $channel,
'count' => 10,
'count' => 5,
'end' => "13466530169226760"
));
print_r($history);
Expand Down Expand Up @@ -147,16 +147,16 @@
## ---------------------------------------------------------------------------
## Presence Example
## ---------------------------------------------------------------------------
echo("\nWaiting for Presence message... Hit CTRL+C to finish.\n");

$pubnub->presence(array(
'channel' => $channel,
'callback' => function($message) {
print_r($message);
echo "\r\n";
return false;
}
));
//echo("\nWaiting for Presence message... Hit CTRL+C to finish.\n");
//
//$pubnub->presence(array(
// 'channel' => $channel,
// 'callback' => function($message) {
// print_r($message);
// echo "\r\n";
// return false;
// }
//));

## ---------------------------------------------------------------------------
## Subscribe Example
Expand Down
22 changes: 11 additions & 11 deletions php/3.3/pubnubPlaintextTests.php
Expand Up @@ -81,7 +81,7 @@
echo "Running detailedHistory\r\n";
$history = $pubnub->detailedHistory(array(
'channel' => $channel,
'count' => 10,
'count' => 5,
'end' => "13466530169226760"
));
print_r($history);
Expand All @@ -108,16 +108,16 @@
## ---------------------------------------------------------------------------
## Presence Example
## ---------------------------------------------------------------------------
//echo("\nWaiting for Presence message... Hit CTRL+C to finish.\n");
//
//$pubnub->presence(array(
// 'channel' => $channel,
// 'callback' => function($message) {
// print_r($message);
// echo "\r\n";
// return true;
// }
//));
echo("\nWaiting for Presence message... Hit CTRL+C to finish.\n");

$pubnub->presence(array(
'channel' => $channel,
'callback' => function($message) {
print_r($message);
echo "\r\n";
return true;
}
));

## ---------------------------------------------------------------------------
## Subscribe Example
Expand Down

0 comments on commit 4efff43

Please sign in to comment.