PHP code example of mintware-de / native-cron-bundle

1. Go to this page and download the library: Download mintware-de/native-cron-bundle 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/ */

    

mintware-de / native-cron-bundle example snippets



#[CronJob(
    name: 'my_cron_job',    // This is the name of the cron job. It is used to trigger the command
                            // using the mw:cron:run command
                      
    #           .---------------- minute (0 - 59)
    #           | .-------------- hour (0 - 23)
    #           | | .------------ day of month (1 - 31)
    #           | | | .---------- month (1 - 12)
    #           | | | | .-------- day of week (0 - 6; Sunday=0)
    #           | | | | |   
    executeAt: '* * * * *', // This is the execution time definition. The format is identical to the crontab file. 
    user: 'root',           // The user that will be used to run the command. Optional, default = root 
    arguments: [            // The arguments that are passed to your command. See also here (ArrayInput): https://symfony.com/doc/current/console/calling_commands.html 
        'name'    => 'Foo', // InputArgument
        '--yell'  => true,  // Input option
    ],
)]
#[AsCommand(...)]
class MyCommand extends \Symfony\Component\Console\Command\Command {
    // ...
}