Mercurial > hg > isophonics-drupal-site
comparison core/lib/Drupal/Core/Extension/module.api.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children | af1871eacc83 |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
477 } | 477 } |
478 | 478 |
479 /** | 479 /** |
480 * Perform a single update between minor versions. | 480 * Perform a single update between minor versions. |
481 * | 481 * |
482 * hook_update_N() can only be used to update between minor versions of a | 482 * Hook hook_update_N() can only be used to update between minor versions of a |
483 * module. To upgrade between major versions of Drupal (for example, between | 483 * module. To upgrade between major versions of Drupal (for example, between |
484 * Drupal 7 and 8), use the @link migrate Migrate API @endlink instead. | 484 * Drupal 7 and 8), use the @link migrate Migrate API @endlink instead. |
485 * | 485 * |
486 * @section sec_naming Naming and documenting your function | 486 * @section sec_naming Naming and documenting your function |
487 * For each change in a module that requires one or more actions to be performed | 487 * For each change in a module that requires one or more actions to be performed |
682 * you should add numerical prefix to NAME or make it completely numerical. | 682 * you should add numerical prefix to NAME or make it completely numerical. |
683 * | 683 * |
684 * Drupal also ensures to not execute the same hook_post_update_NAME() function | 684 * Drupal also ensures to not execute the same hook_post_update_NAME() function |
685 * twice. | 685 * twice. |
686 * | 686 * |
687 * @section sec_bulk Batch updates | |
688 * If running your update all at once could possibly cause PHP to time out, use | |
689 * the $sandbox parameter to indicate that the Batch API should be used for your | |
690 * update. In this case, your update function acts as an implementation of | |
691 * callback_batch_operation(), and $sandbox acts as the batch context | |
692 * parameter. In your function, read the state information from the previous | |
693 * run from $sandbox (or initialize), run a chunk of updates, save the state in | |
694 * $sandbox, and set $sandbox['#finished'] to a value between 0 and 1 to | |
695 * indicate the percent completed, or 1 if it is finished (you need to do this | |
696 * explicitly in each pass). | |
697 * | |
698 * See the @link batch Batch operations topic @endlink for more information on | |
699 * how to use the Batch API. | |
700 * | |
687 * @param array $sandbox | 701 * @param array $sandbox |
688 * Stores information for batch updates. See above for more information. | 702 * Stores information for batch updates. See above for more information. |
689 * | 703 * |
690 * @return string|null | 704 * @return string|null |
691 * Optionally, hook_post_update_NAME() hooks may return a translated string | 705 * Optionally, hook_post_update_NAME() hooks may return a translated string |
931 // Report Drupal version | 945 // Report Drupal version |
932 if ($phase == 'runtime') { | 946 if ($phase == 'runtime') { |
933 $requirements['drupal'] = [ | 947 $requirements['drupal'] = [ |
934 'title' => t('Drupal'), | 948 'title' => t('Drupal'), |
935 'value' => \Drupal::VERSION, | 949 'value' => \Drupal::VERSION, |
936 'severity' => REQUIREMENT_INFO | 950 'severity' => REQUIREMENT_INFO, |
937 ]; | 951 ]; |
938 } | 952 } |
939 | 953 |
940 // Test PHP version | 954 // Test PHP version |
941 $requirements['php'] = [ | 955 $requirements['php'] = [ |