PHP code example of ghaninia / shamsic

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

    

ghaninia / shamsic example snippets

 
use GhaniniaIR\Shamsic\Schedule;

### At every minute on saturday in farvardin.
(new Schedule)
    ->call(function(){
        echo "test";
    })
    ->cron("* * * 1 2");

### At every minute on every day-of-week from saturday through thursday in khordad.
(new Schedule)
    ->call(function(){
        echo "test";
    })
    ->cron("* * * 3 1-5");

... 


### After writing all the schedules, you must run them
Schedule::run();

 
(new ExecuteExpression("* * * * *"))->isValid();
 bash 
* * * * * php output.php