
| Current Path : /var/www/html/strat/web/core/modules/system/tests/modules/destructable_test/src/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/strat/web/core/modules/system/tests/modules/destructable_test/src/Destructable.php |
<?php
namespace Drupal\destructable_test;
use Drupal\Core\DestructableInterface;
final class Destructable implements DestructableInterface {
/**
* Semaphore filename.
*
* @var string
*/
protected string $semaphore;
/**
* Set the destination for the semaphore file.
*
* @param string $semaphore
* Temporary file to set a semaphore flag.
*/
public function setSemaphore(string $semaphore): void {
$this->semaphore = $semaphore;
}
/**
* {@inheritdoc}
*/
public function destruct() {
sleep(3);
file_put_contents($this->semaphore, 'ran');
}
}