function hold_test_request
Same name in other branches
- 8.9.x core/modules/system/tests/modules/hold_test/hold_test.module \hold_test_request()
- 10 core/modules/system/tests/modules/hold_test/hold_test.module \hold_test_request()
- 11.x core/modules/system/tests/modules/hold_test/hold_test.module \hold_test_request()
Request hold.
Parameters
bool $status: TRUE - enable hold, FALSE - disable hold.
1 call to hold_test_request()
- hold_test_install in core/
modules/ system/ tests/ modules/ hold_test/ hold_test.install - Implements hook_install().
File
-
core/
modules/ system/ tests/ modules/ hold_test/ hold_test.module, line 16
Code
function hold_test_request($status) {
$site_path = \Drupal::getContainer()->getParameter('site.path');
file_put_contents($site_path . '/hold_test_request.txt', $status);
// If we're releasing the hold wait for a bit to allow the subscriber to read
// the file.
if (!$status) {
usleep(HoldTestSubscriber::WAIT * 2);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.