8000 minor #19429 [Scheduler] Document hashed cron expressions (javieregui… · symfony/symfony-docs@95b2026 · GitHub
[go: up one dir, main page]

Skip to content

Commit 95b2026

Browse files
committed
minor #19429 [Scheduler] Document hashed cron expressions (javiereguiluz)
This PR was merged into the 6.3 branch. Discussion ---------- [Scheduler] Document hashed cron expressions Fixes #18255. I took the list of expressions from the PR #18290 created by `@andreybolonin` Commits ------- 0213c09 [Scheduler] Document hashed cron expressions
2 parents 0677a39 + 0213c09 commit 95b2026

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

scheduler.rst

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,28 @@ class, as shown in the following examples.
157157
Cron Expression Triggers
158158
~~~~~~~~~~~~~~~~~~~~~~~~
159159

160-
It uses the same syntax as the `cron command-line utility`_::
160+
Before using cron triggers, you have to install the following dependency:
161+
162+
.. code-block:: terminal
163+
164+
composer require dragonmantank/cron-expression
165+
166+
Then, define the trigger date/time using the same syntax as the
167+
`cron command-line utility`_::
161168

162169
RecurringMessage::cron('* * * * *', new Message());
163170

164-
Before using it, you have to install the following dependency:
171+
You can also used some special values that represent common cron expressions:
165172

166-
.. code-block:: terminal
173+
* ``#yearly``, ``#annually`` - Run once a year, midnight, Jan. 1 - ``0 0 1 1 *``
174+
* ``#monthly`` - Run once a month, midnight, first of month - ``0 0 1 * *``
175+
* ``#weekly`` - Run once a week, midnight on Sun - ``0 0 * * 0``
176+
* ``#daily``, ``#midnight`` - Run once a day, midnight - ``0 0 * * *``
177+
* ``#hourly`` - Run once an hour, first minute - ``0 * * * *``
167178

168-
composer require dragonmantank/cron-expression
179+
For example::
180+
181+
RecurringMessage::cron('#daily', new Message());
169182

170183
.. tip::
171184

0 commit comments

Comments
 (0)
0