diff options
author | Hans Duedal <hd@onlinecity.dk> | 2011-04-20 20:36:38 -0700 |
---|---|---|
committer | Hans Duedal <hd@onlinecity.dk> | 2011-04-20 20:36:38 -0700 |
commit | 5305801bf025e7475c0d1ff8d46cdf0b9caf8d15 (patch) | |
tree | 348a0458d1377c78bcfe3b28e4ae5fd3b1274de2 | |
parent | f2457db78a7f219d5bbc108c4b133deb41023c74 (diff) | |
download | php-smpp-5305801bf025e7475c0d1ff8d46cdf0b9caf8d15.zip php-smpp-5305801bf025e7475c0d1ff8d46cdf0b9caf8d15.tar.gz php-smpp-5305801bf025e7475c0d1ff8d46cdf0b9caf8d15.tar.bz2 |
Added new code highlighting blocks, see https://github.com/blog/832-rolling-out-the-redcarpet
-rw-r--r-- | README.markdown | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/README.markdown b/README.markdown index ccb3b13..3e55dfa 100644 --- a/README.markdown +++ b/README.markdown @@ -18,6 +18,7 @@ Basic usage example To send a SMS you can do: +``` php <?php require_once 'autoload.php'; @@ -49,10 +50,11 @@ To send a SMS you can do: // Cleanup $smpp->close(); unset($smpp); - +``` php To receive a SMS: - + +``` php <?php require_once 'autoload.php'; @@ -79,7 +81,8 @@ To receive a SMS: // Cleanup $smpp->close(); unset($smpp); - +``` + Multi-process use example ----- @@ -87,6 +90,7 @@ This example will run 10 sender workers, and a single receiver for delivery rece Start all the workers by running: +``` php <?php // File "run.php" require_once 'autoload.php'; @@ -102,11 +106,13 @@ Start all the workers by running: $queue = msg_get_queue(ftok(realpath('autoload.php'),'S')); $factory = new \gateway\workers\SmsFactory(); $factory->startAll($options, $queue); - +``` + The factory (and thus the script) will run indefinitively, and if a worker exits/dies, it will respawn it. Then another script injects a SMS into the queue: +``` php <?php // File "inject.php" use gateway\workers\queue\SmsRequest; @@ -116,4 +122,4 @@ Then another script injects a SMS into the queue: $smsrequest = new SmsRequest('H€llo world', array(4512345678), 'SMPP Test', 1337); msg_send($queue, SmsRequest::TYPE, $smsrequest, true); - +``` |