PHPackages                             ghaninia/shamsic - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ghaninia/shamsic

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ghaninia/shamsic
================

1.0.1(3y ago)651MITPHPPHP ^8.1.0CI failing

Since Jul 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ghaninia/shamsic)[ Packagist](https://packagist.org/packages/ghaninia/shamsic)[ RSS](/packages/ghaninia-shamsic/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (5)Used By (0)

 [![](./art/art.png)](./art/art.png)

 Shamsic
=========

[](#----shamsic)

 Maybe it happened to you that you wanted to use CronJob in your project and you realized that you cannot manage the exact dates that are in the solar calendar.

 For example, cron job allows you to run your script on specific days of the week, month! But CronJob supports the Gregorian calendar.It is useless or can be done with low accuracy for the solar date!

 This package allows you to solve this problem inside the PHP code.

> This package supports `PHP 8.1+`.

---

Install
-------

[](#install)

Via Composer

```
$ composer require ghaninia/shamsic
```

How to use
----------

[](#how-to-use)

You need to configure the cron job on the server ,The crontab command shown below will activate the cron tasks automatically every minutes:

```
* * * * * php output.php
```

> '\*' is a wildcard, meaning "every time". If you don't have any background about CronJob expressions and don't clear for you, follow the link [crontab](https://crontab.guru/).

```
.---------------- minute (0 - 59)
|  .------------- hour (0 - 23)
|  |  .---------- day of month (1 - 31)
|  |  |  .------- month (1 - 12)
|  |  |  |  .---- day of week (0 - 6)
|  |  |  |  |
*  *  *  *  *  command to be executed
```

The last three expressions of the cronJob are for the day of the month, the month and the day of the week. (Our main problem)

Now, open the file that will be executed by Cron Job (for this example output.php).

```
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();
```

 If you want to check that your expression is valid or not :

```
(new ExecuteExpression("* * * * *"))->isValid();
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

1443d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/41255155?v=4)[Amin Ghaninia](/maintainers/ghaninia)[@ghaninia](https://github.com/ghaninia)

---

Top Contributors

[![ghaninia](https://avatars.githubusercontent.com/u/41255155?v=4)](https://github.com/ghaninia "ghaninia (28 commits)")

---

Tags

cronjobphpschedule

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ghaninia-shamsic/health.svg)

```
[![Health](https://phpackages.com/badges/ghaninia-shamsic/health.svg)](https://phpackages.com/packages/ghaninia-shamsic)
```

###  Alternatives

[mokhosh/filament-jalali

Add Jalali datetime to your filament tables

6947.1k2](/packages/mokhosh-filament-jalali)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
