PHP code example of stepotronic / logjamdispatcher
1. Go to this page and download the library: Download stepotronic/logjamdispatcher library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
stepotronic / logjamdispatcher example snippets
use LogjamDispatcher\Dispatcher\ZmqDispatcher;
use LogjamDispatcher\Logjam\Message;
$dispatcher = new ZmqDispatcher(array('tcp://my.broker'), 'myapp', 'dev');
$message = new Message();
// fill message object
$message->setMethod('GET');
//.....
$dispatcher->dispatch($message);
$dispatcher = new ZmqDispatcher(array('tcp://my.broker'), 'myapp', 'dev', ZmqDispatcher::createZmqSocket());
use LogjamDispatcher\Http\FilteredRequestInformationDecorator;
use LogjamDispatcher\Http\RequestInformation;
$message = new Message();
// ....
$requestInformation = new RequestInformation();
$requestInformation->setBodyParameters(array(
'password' => 'foo-bar123'
));
$requestInformation = new FilteredRequestInformationDecorator($requestInformation, array('password'), '*****');
print_r($requestInformation->getBodyParameters());
// outputs: Array([password] => *****)
$message->setRequestInformation($requestInformation);
//....