| Server IP : 3.147.158.171 / Your IP : 216.73.216.216 Web Server : Apache/2.4.67 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-2-178.us-east-2.compute.internal 6.1.172-216.329.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Wed May 20 06:31:34 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.21 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /tsai/repo/store/vendor/drush/drush/ |
Upload File : |
<?php
/**
* @file
* Drupal hooks provided by the Drush package.
*/
/**
* Executes a deploy function which is intended to update data, like entities,
* after config is imported during a deployment.
*
* These are a higher level alternative to hook_update_n and hook_deploy_NAME
* functions and have to be placed in a MODULE.deploy.php file.
*
* NAME can be arbitrary machine names. In contrast to hook_update_N() the
* alphanumeric naming of functions in the file is the only thing which ensures
* the execution order of those functions. If update order is mandatory,
* you should add numerical prefix to NAME or make it completely numerical.
*
* Drupal also ensures to not execute the same hook_deploy_NAME() function
* twice.
*
* @param array $sandbox
* Stores information for batch updates.
*
* @return string|null
* Optionally, hook_deploy_NAME() hooks may return a translated string
* that will be displayed to the user after the update has completed. If no
* message is returned, no message will be presented to the user.
*
* @throws \Exception
* In case of error, update hooks should throw an instance of
* \Exception with a meaningful message for the user.
*
* @ingroup update_api
*
* @see hook_update_N()
* @see hook_post_update_NAME()
*/
function hook_deploy_NAME(array &$sandbox): string {
$node = \Drupal\node\Entity\Node::load(123);
$node->setTitle('foo');
$node->save();
return t('Node %nid saved', ['%nid' => $node->id()]);
}