PHP

Project Moved
The PHP Client previously documented here has moved to FUSEForge

Labels

php php Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Nov 30, 2007

    larry h. says:

    The test page for the php client, Test.php, lacks feedback. Here is a version w...

    The test page for the php client, Test.php, lacks feedback. Here is a version with more description of what is going right and wrong:

     <?php
    
     try {
    	require_once 'Stomp.php';
    
    	echo 'Creating StompConnection object... <br />';
    	$c = new StompConnection("127.0.0.1");  // requires Socket extension
    	echo 'Connecting with user/pass... <br />';
    	$result = $c->connect("hiram", "test");
    	print_r($result);
    
    	echo '<br />Subscribing... <br />';
    	$c->subscribe("/queue/FOO");
    	echo 'Sending message... <br />';
    	$c->send("/queue/FOO", "Hello World!");
    
    	// Wait for the message to come in..
    	echo 'Waiting for incoming message... <br />';
    	$result = $c->readFrame();
    	print_r($result);
    
    	$c->disconnect();
    
    	echo '<br />Finished';
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), "\n";
    }
    
    
    ?>
    
    
    
  2. Nov 30, 2007

    larry h. says:

    The script Stomp.php requires the 'socket' extension (it was not on my Windows i...

    The script Stomp.php requires the 'socket' extension (it was not on my Windows install). Add that extension if you cannot get past

        socket_create()
    
  3. Nov 30, 2007

    larry h. says:

    The issue tracker appears to be misdirecting to iona.com, so I'll add this here ...

    The issue tracker appears to be misdirecting to iona.com, so I'll add this here for now:  There are deprecations in Stomp.php     

    Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of socket_recv(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\drupal\Stomp.php on line 156

    Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of socket_recv(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\drupal\Stomp.php on line 175

    Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of socket_recv(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\drupal\Stomp.php on line 185

  4. Dec 10, 2007

    larry h. says:

    To fix the warnings above, change Stomp.php, removing the ampersand on the $b (b...

    To fix the warnings above, change Stomp.php, removing the ampersand on the $b (buffer) arg in those lines. In other words, go from

            $rc = socket_recv($this->socket, &$b, 1, 0);
    

     to

            $rc = socket_recv($this->socket, $b, 1, 0);