{"id":20569563,"url":"https://github.com/ghaninia/shamsic","last_synced_at":"2025-08-11T21:37:07.070Z","repository":{"id":46895795,"uuid":"512387445","full_name":"ghaninia/shamsic","owner":"ghaninia","description":"Do you want CronJob to follow the solar date?You need this package to solve this problem.","archived":false,"fork":false,"pushed_at":"2022-07-20T19:30:34.000Z","size":91,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-15T05:19:53.759Z","etag":null,"topics":["cronjob","php","schedule"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghaninia.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-10T08:51:45.000Z","updated_at":"2023-12-02T19:17:54.000Z","dependencies_parsed_at":"2022-08-28T11:22:46.608Z","dependency_job_id":null,"html_url":"https://github.com/ghaninia/shamsic","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ghaninia/shamsic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghaninia%2Fshamsic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghaninia%2Fshamsic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghaninia%2Fshamsic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghaninia%2Fshamsic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghaninia","download_url":"https://codeload.github.com/ghaninia/shamsic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghaninia%2Fshamsic/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269962250,"owners_count":24504270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cronjob","php","schedule"],"created_at":"2024-11-16T05:08:51.804Z","updated_at":"2025-08-11T21:37:06.989Z","avatar_url":"https://github.com/ghaninia.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"./art/art.png\" /\u003e\n\u003c/div\u003e\n\u003ch1 align=\"center\"\u003e\n    Shamsic\n\u003c/h1\u003e\n\n\u003c!-- \u003cp align=\"center\" dir=\"rtl\"\u003e\nشاید برای شما پیش اومده که میخواستید از کرون جاب در پروژه تون استفاده کنید و متوجه شدید که نمیتونید تاریخهای دقیق رو که در تقویم شمسی وجود داره مدیریت کنید. برای مثال کرون جاب به شما اجازه میده که اسکریپتتون در روزهای خاص هفته, ماه اجرا بشه! ولی چون کرون از تقویم میلادی پشیبانی میکنه ,مدیریتش برای ایرانی های که از تقویم شمسی استفاده میکنن بی استفاده یا با ضریب دقت کم \n\u003c/p\u003e --\u003e\n\n\u003cp\u003e\n    Maybe it happened to you that you wanted to use CronJob in your project and you realized that you cannot manage the\n    exact dates that are in the solar calendar.\n\u003c/p\u003e\n\u003cp\u003e\n    For example, cron job allows you to run your script on specific days of the week, month! But CronJob supports the\n    Gregorian calendar.It is useless or can be done with low accuracy for the solar date!\n\u003c/p\u003e\n\u003cp\u003e\n    This package allows you to solve this problem inside the PHP code.\n\u003c/p\u003e\n\n\u003e This package supports `PHP 8.1+`.\n\n\u003chr /\u003e\n\n## Install\n\nVia Composer\n\n``` bash\n$ composer require ghaninia/shamsic\n```\n\n## How to use\n\nYou need to configure the cron job on the server ,The crontab command shown below will activate the cron tasks automatically every minutes:\n\n``` bash \n* * * * * php output.php\n```\n\n\u003e '*' 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 \u003ca href=\"https://crontab.guru/\"\u003ecrontab\u003c/a\u003e.\n\n\n``` bash\n.---------------- minute (0 - 59) \n|  .------------- hour (0 - 23)\n|  |  .---------- day of month (1 - 31)\n|  |  |  .------- month (1 - 12) \n|  |  |  |  .---- day of week (0 - 6) \n|  |  |  |  |\n*  *  *  *  *  command to be executed\n```\n\nThe last three expressions of the cronJob are for the day of the month, the month and the day of the week. (Our main problem)\n\n\nNow, open the file that will be executed by Cron Job (for this example output.php).\n\n```php \nuse GhaniniaIR\\Shamsic\\Schedule;\n\n### At every minute on saturday in farvardin.\n(new Schedule)\n    -\u003ecall(function(){\n        echo \"test\";\n    })\n    -\u003ecron(\"* * * 1 2\");\n\n### At every minute on every day-of-week from saturday through thursday in khordad.\n(new Schedule)\n    -\u003ecall(function(){\n        echo \"test\";\n    })\n    -\u003ecron(\"* * * 3 1-5\");\n\n... \n\n\n### After writing all the schedules, you must run them\nSchedule::run();\n\n```\n\n\u003cp\u003e\n If you want to check that your expression is valid or not :\n\u003c/p\u003e\n\n```php \n(new ExecuteExpression(\"* * * * *\"))-\u003eisValid();\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghaninia%2Fshamsic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghaninia%2Fshamsic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghaninia%2Fshamsic/lists"}