File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1
1
# RibsCronBundle
2
2
RibsCronBundle is a bunlde to use cron via curl a url of you website with cron based time
3
+
4
+ ## Create you first method called by ribs_cron
5
+
6
+ Craete a new Controller class and extends it to RibsCronController.
7
+ Create a method with the name you want like this example :
8
+ ``` PHP
9
+ <?php
10
+
11
+ namespace App\Controller;
12
+
13
+ use PiouPiou\RibsCronBundle\Controller\RibsCronController;
14
+
15
+ class TestCronController extends RibsCronController
16
+ {
17
+ public function testCronCall()
18
+ {
19
+ // do action called by /ribs-cron
20
+ }
21
+ }
22
+ ```
23
+
24
+ Now to make this method called by /ribs-cron url you must add it to ribs_cron.yaml config file like this :
25
+ ``` YML
26
+ parameters :
27
+ data_directory : ' %kernel.project_dir%/data/'
28
+ ribs_cron :
29
+ testCronCall : " * * * * *"
30
+ ` ` `
31
+
32
+ After that each time you have in your crontab file a curl to /ribs-cron url testCronCall method will be executed each minute.
33
+ Parameters in quote run like standard cron time system.
34
+
35
+ ## How to call your cron url at any time with external url
36
+
37
+ In you .env file you can add two parameters :
38
+ IP_CRON_EXTERNAL to add external IP that can call your cron
39
+ IP_CRON_INTERNAL= internals IPS of the server that can call your cron
You can’t perform that action at this time.
0 commit comments