CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • extensions and CLI
Pages: [1]

Author Topic: extensions and CLI  (Read 463 times)

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
extensions and CLI
December 02, 2013, 01:46:58 pm
Hi,

I'm contributing to a recurring payment processor extension which has a daily job to process upcoming payments. It would be nice to set this up as a Job that can be invoked from the CiviCRM cron.

My reading of the code suggests we'd need to add a function like civicrm_api3_job_<name>() and then create an item in the civicrm_job table with <name>. That seems intrusive on the core functionality, even though our <name> is unlikely to be used by core.

Is there a "proper" way to do this for extensions?

Thanks,

Ken

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: extensions and CLI
December 02, 2013, 02:32:30 pm
If the extension is based on civix, try something like:

Quote
civix generate:api Job MyAction --schedule Hourly

See also:

http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-Howdoesoneaddacronjob?
http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-AddanAPIfunction

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • extensions and CLI

This forum was archived on 2017-11-26.