PHP code example of takuya / php-atq-wrapper

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

    

takuya / php-atq-wrapper example snippets



    use SystemUtil\AtJobs;
    $at_job = new AtJobs( 'ssh server docker exec ubuntu1604 -- at' );
    $id = $at_job->add( '+30days', 'echo Hello 2','s' );
    $at_job->exists($id);// => true
    $at_job->get_body( $id ); //=> /bin/sh body will be executed.
    $at_job->remove($id); //=> cancel job.


    use SystemUtil\AtJobs;
    $at_job = new AtJobs( 'ssh server docker exec ubuntu1604 -- at' );
    foreach ($at_job->queue() as $job) {
      $job->id;
      $job->start;
      $job->q;
      $job->user;
      $job->body();
    }



    use SystemUtil\AtJobs;
    $at_job = new AtJobs( 'ssh server docker exec ubuntu1604 -- at' );
    foreach ($at_job->queue('a') as $job) {
      $job->remove();
    }
shell
composer