It would be nice to be able to put the cron callbacks in include files. I'd suggest to implement it like hook_menu and hook_theme, with a "file" property in hook_cronapi().

Comments

gotheric’s picture

Status: Active » Fixed

This feature is already available.

See API.txt:

9 function hook_cronapi($op, $job = NULL) {
10   $items['key'] = array(
11     'description' => 'string',
12     'rule' => 'string',
13     'weight' => 1234,
14     'callback' => 'function_name', 
15     'arguments' => array(...),
16     'file' => 'string', // External file, like hook_menu
17     'file path' => 'string'
18   );
19   $items['key2'] = ...
20   ...
21   return $items;
22 }

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.