Example #1
0
<?php

require dirname(__DIR__) . '/vendor/autoload.php';
//setup pushover client
$pusher = new \Vdbf\Pushover\Client(array('token' => $argv[1]), new \GuzzleHttp\Client());
//compose a message for a recipient with as optional third parameter options like priority and notification sound
$message = new \Vdbf\Pushover\TitledMessage($argv[2], $argv[3], $argv[4]);
//push a message
$pusher->send($message);
Example #2
0
<?php

require dirname(__DIR__) . '/vendor/autoload.php';
//setup pushover client
$pusher = new \Vdbf\Pushover\Client(array('token' => $argv[1]), $client = new \GuzzleHttp\Client());
//compose a message for a recipient with as optional third parameter options like priority and notification sound
$message = new \Vdbf\Pushover\Message($argv[2], $argv[3]);
//push a message
$requests = $pusher->batch(function ($pusher) use($message) {
    $pusher->send($message);
    $pusher->send($message);
    $pusher->send($message);
});
$pool = new \GuzzleHttp\Pool($client, $requests);
$pool->wait();