PHP code example of stekycz / cronner

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

    

stekycz / cronner example snippets


class CronTasks
{
    /**
     * @cronner-task E-mail sending
     * @cronner-period 1 day
     * @cronner-days working days
     * @cronner-time 23:30 - 05:00
     */
    public function sendEmails(): void
    {
        // Code which sends all your e-mails
    }


    /**
     * @cronner-task Important data replication
     * @cronner-period 3 hours
     */
    public function replicateImportantData(): void
    {
        // Replication code
    }
}

class CronPresenter extends \Nette\Application\UI\Presenter
{
    /**
     * @var \Bileto\Cronner\Cronner
     * @inject
     */
    public $cronner;

    
    public function actionCron(): void
    {
        $this->cronner->run();
    }
}

/**
 * @cronner-task Fetches all public data from all registered social networks
 */

/**
 * @cronner-period 1 day
 */

/**
 * @cronner-days working days, Sun
 */

/**
 * @cronner-time 11:00, 23:30 - 05:00
 */