PHP code example of geekcom / felicio

1. Go to this page and download the library: Download geekcom/felicio 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/ */

    

geekcom / felicio example snippets




use Felicio\Felicio;

$felicioDotFile = __DIR__ . '/.felicio';

$felicio = new Felicio($felicioDotFile);

$params = [
    'QueueUrl' => 'https://sqs.us-west-2.amazonaws.com/999999999/my_queue',
    'MessageBody' => 'test message'
];

$felicio->sendMessage($params);



use Felicio\Felicio;

$felicioDotFile = __DIR__ . '/.felicio';

$felicio = new Felicio($felicioDotFile);

$params = [
    'AttributeNames' => ['SentTimestamp'],
    'MaxNumberOfMessages' => 1,
    'MessageAttributeNames' => ['All'],
    'QueueUrl' => 'https://sqs.us-west-2.amazonaws.com/999999999/my_queue',
    'WaitTimeSeconds' => 0,
];

$message = $felicio->receiveMessage($params);

var_dump($message);



use Felicio\Felicio;

$felicioDotFile = __DIR__ . '/.felicio';

$felicio = new Felicio($felicioDotFile);

$params = [
    'QueueUrl' => 'https://sqs.us-west-2.amazonaws.com/999999999/my_queue',
    'ReceiptHandle' => '', // 



use Felicio\Felicio;

$felicioDotFile = __DIR__ . '/.felicio';

$felicio = new Felicio($felicioDotFile);

$queueUrl = 'https://sqs.us-west-2.amazonaws.com/999999999/my_queue';

$messages = $felicio->countMessages($queueUrl);

var_dump($messages);