
| Current Path : /var/www/html/stolberg/web/core/tests/Drupal/TestSite/Commands/ |
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/stolberg/web/core/tests/Drupal/TestSite/Commands/TestSiteReleaseLocksCommand.php |
<?php
declare(strict_types=1);
namespace Drupal\TestSite\Commands;
use Drupal\Core\Test\TestDatabase;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Command to release all test site database prefix locks.
*
* Note that this command can't be safely tested by DrupalCI without potentially
* causing random failures.
*
* @internal
*/
class TestSiteReleaseLocksCommand extends Command {
/**
* {@inheritdoc}
*/
protected function configure() {
$this->setName('release-locks')
->setDescription('Releases all test site locks')
->setHelp('The locks ensure test site database prefixes are not reused.');
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output): int {
$root = dirname(__DIR__, 5);
chdir($root);
TestDatabase::releaseAllTestLocks();
$output->writeln('<info>Successfully released all the test database locks</info>');
return 0;
}
}