Skip to content

RibsCronBundle is a bunlde to use cron via curl a url of you website with cron based time

License

Notifications You must be signed in to change notification settings

Ribs-organization/RibsCronBundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RibsCronBundle

RibsCronBundle is a bunlde to use cron via curl a url of you website with cron based time

Create you first method called by ribs_cron

Craete a new Controller class and extends it to RibsCronController. Create a method with the name you want like this example :

<?php

namespace App\Controller;

use PiouPiou\RibsCronBundle\Controller\RibsCronController;

class TestCronController extends RibsCronController
{
    public function testCronCall()
    {
        // do action called by /ribs-cron
    }
}

Now to make this method called by /ribs-cron url you must add it to ribs_cron.yaml config file like this :

parameters:
  data_directory: '%kernel.project_dir%/data/'
  ribs_cron:
    testCronCall: "* * * * *"

After that each time you have in your crontab file a curl to /ribs-cron url testCronCall method will be executed each minute. Parameters in quote run like standard cron time system.

How to call your cron url at any time with external url

In you .env file you can add two parameters : IP_CRON_EXTERNAL to add external IP that can call your cron IP_CRON_INTERNAL= internal IP of the server that can call your cron

About

RibsCronBundle is a bunlde to use cron via curl a url of you website with cron based time

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages