PHP code example of treffynnon / php-at-job-queue-wrapper

1. Go to this page and download the library: Download treffynnon/php-at-job-queue-wrapper 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/ */

    

treffynnon / php-at-job-queue-wrapper example snippets



use Treffynnon\At\Wrapper as At

// create a command job
$job = 'echo "hello" | wall';
$time = 'now + 1min';
// save command job to queue letter c
$queue = 'c';
At::cmd($job, $time, $queue);

// create a file job
$job = '/home/example/example.sh';
// save file job to queue letter f
$queue = 'f';
At::file($job, $time, $queue);

// create a file job and send it to
// the default queue (determined by at)
At::file($job, $time);

// get a list of all the jobs in the queue
var_dump(At::lq());

// get a list of all the jobs in the f queue
var_dump(At::lq('f'));

// get a list of all the jobs in the c queue
var_dump(At::listQueue('c'));