Skip to content

Commit 03cd960

Browse files
authored
add explanations of how RibsCronBundle works
1 parent 53e26fb commit 03cd960

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,39 @@
11
# RibsCronBundle
22
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

0 commit comments

Comments
 (0)