PHP code example of mybuilder / cronos

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

    

mybuilder / cronos example snippets




 = new MyBuilder\Cronos\Formatter\Cron;
$cron
    ->header()
        ->setPath('path')
        ->setHome('home')
        ->setMailto('[email protected]')
        ->setShell('shell')
        ->setContentType('text')
        ->setContentTransferEncoding('utf8')
    ->end()
    ->comment('Comment')
    ->job('/bin/bash command --env=dev')
        ->setMinute(1)
        ->setHour(2)
        ->setDayOfMonth(3)
        ->setMonth(4)
        ->setDayOfWeek(5)
        ->setStandardOutFile('log')
        ->appendStandardErrorToFile('error')
    ->end();

echo $cron->format();



yBuilder\Cronos\Formatter\Cron;
use MyBuilder\Cronos\Updater\CronUpdater;

$cron = new Cron;
// $cron configuration...

$cronUpdater = CronUpdater::createDefault();
$cronUpdater->replaceWith($cron);