Revision db2d93dd
Added by Benjamin Luce over 9 years ago
drupal7/modules/system/system.api.php | ||
---|---|---|
606 | 606 |
* @return |
607 | 607 |
* An associative array where the key is the queue name and the value is |
608 | 608 |
* again an associative array. Possible keys are: |
609 |
* - 'worker callback': A PHP callable to call that is an implementation of
|
|
609 |
* - 'worker callback': The name of an implementation of
|
|
610 | 610 |
* callback_queue_worker(). |
611 | 611 |
* - 'time': (optional) How much time Drupal should spend on calling this |
612 | 612 |
* worker in seconds. Defaults to 15. |
... | ... | |
643 | 643 |
$queues['aggregator_feeds']['time'] = 90; |
644 | 644 |
} |
645 | 645 |
|
646 |
/** |
|
647 |
* Work on a single queue item. |
|
648 |
* |
|
649 |
* Callback for hook_queue_info(). |
|
650 |
* |
|
651 |
* @param $queue_item_data |
|
652 |
* The data that was passed to DrupalQueue::createItem() when the item was |
|
653 |
* queued. |
|
654 |
* |
|
655 |
* @throws \Exception |
|
656 |
* The worker callback may throw an exception to indicate there was a problem. |
|
657 |
* The cron process will log the exception, and leave the item in the queue to |
|
658 |
* be processed again later. |
|
659 |
* |
|
660 |
* @see drupal_cron_run() |
|
661 |
*/ |
|
662 |
function callback_queue_worker($queue_item_data) { |
|
663 |
$node = node_load($queue_item_data); |
|
664 |
$node->title = 'Updated title'; |
|
665 |
$node->save(); |
|
666 |
} |
|
667 |
|
|
668 | 646 |
/** |
669 | 647 |
* Allows modules to declare their own Form API element types and specify their |
670 | 648 |
* default values. |
... | ... | |
3715 | 3693 |
* |
3716 | 3694 |
* Any tasks you define here will be run, in order, after the installer has |
3717 | 3695 |
* finished the site configuration step but before it has moved on to the |
3718 |
* final import of languages and the end of the installation. You can have any |
|
3719 |
* number of custom tasks to perform during this phase. |
|
3696 |
* final import of languages and the end of the installation. This is invoked |
|
3697 |
* by install_tasks(). You can have any number of custom tasks to perform |
|
3698 |
* during this phase. |
|
3720 | 3699 |
* |
3721 | 3700 |
* Each task you define here corresponds to a callback function which you must |
3722 | 3701 |
* separately define and which is called when your task is run. This function |
... | ... | |
3809 | 3788 |
* |
3810 | 3789 |
* @see install_state_defaults() |
3811 | 3790 |
* @see batch_set() |
3791 |
* @see hook_install_tasks_alter() |
|
3792 |
* @see install_tasks() |
|
3812 | 3793 |
*/ |
3813 | 3794 |
function hook_install_tasks(&$install_state) { |
3814 | 3795 |
// Here, we define a variable to allow tasks to indicate that a particular, |
... | ... | |
3911 | 3892 |
/** |
3912 | 3893 |
* Alter the full list of installation tasks. |
3913 | 3894 |
* |
3895 |
* This hook is invoked on the install profile in install_tasks(). |
|
3896 |
* |
|
3914 | 3897 |
* @param $tasks |
3915 | 3898 |
* An array of all available installation tasks, including those provided by |
3916 | 3899 |
* Drupal core. You can modify this array to change or replace any part of |
... | ... | |
3918 | 3901 |
* is selected. |
3919 | 3902 |
* @param $install_state |
3920 | 3903 |
* An array of information about the current installation state. |
3904 |
* |
|
3905 |
* @see hook_install_tasks() |
|
3906 |
* @see install_tasks() |
|
3921 | 3907 |
*/ |
3922 | 3908 |
function hook_install_tasks_alter(&$tasks, $install_state) { |
3923 | 3909 |
// Replace the "Choose language" installation task provided by Drupal core |
... | ... | |
4804 | 4790 |
* @{ |
4805 | 4791 |
*/ |
4806 | 4792 |
|
4793 |
/** |
|
4794 |
* Work on a single queue item. |
|
4795 |
* |
|
4796 |
* Callback for hook_cron_queue_info(). |
|
4797 |
* |
|
4798 |
* @param $queue_item_data |
|
4799 |
* The data that was passed to DrupalQueueInterface::createItem() when the |
|
4800 |
* item was queued. |
|
4801 |
* |
|
4802 |
* @throws Exception |
|
4803 |
* The worker callback may throw an exception to indicate there was a problem. |
|
4804 |
* The cron process will log the exception, and leave the item in the queue to |
|
4805 |
* be processed again later. |
|
4806 |
* |
|
4807 |
* @see drupal_cron_run() |
|
4808 |
*/ |
|
4809 |
function callback_queue_worker($queue_item_data) { |
|
4810 |
$node = node_load($queue_item_data); |
|
4811 |
$node->title = 'Updated title'; |
|
4812 |
node_save($node); |
|
4813 |
} |
|
4814 |
|
|
4807 | 4815 |
/** |
4808 | 4816 |
* Return the URI for an entity. |
4809 | 4817 |
* |
Also available in: Unified diff
Update to 7.37