Created
February 23, 2015 06:38
-
-
Save brgmn/97065528f2f175d38320 to your computer and use it in GitHub Desktop.
MySQL wait_timeout test command for TYPO3 Flow (assuming wait_timeout in MySQL is set to 10 seconds).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Brgmn\Test\Command; | |
/* * | |
* This script belongs to the TYPO3 Flow package "Brgmn.Test". * | |
* * | |
* */ | |
use TYPO3\Flow\Annotations as Flow; | |
use TYPO3\Flow\Persistence\Doctrine\PersistenceManager; | |
use TYPO3\Neos\Domain\Model\Domain; | |
use TYPO3\Neos\Domain\Repository\DomainRepository; | |
use TYPO3\Neos\Domain\Repository\SiteRepository; | |
/** | |
* @Flow\Scope("singleton") | |
*/ | |
class TestCommandController extends \TYPO3\Flow\Cli\CommandController { | |
/** | |
* @Flow\Inject | |
* @var PersistenceManager | |
*/ | |
protected $persistenceManager; | |
/** | |
* @Flow\Inject | |
* @var SiteRepository | |
*/ | |
protected $siteRepository; | |
/** | |
* @Flow\Inject | |
* @var DomainRepository | |
*/ | |
protected $domainRepository; | |
/** | |
* An example command | |
* | |
* The comment of this command method is also used for TYPO3 Flow's help screens. The first line should give a very short | |
* summary about what the command does. Then, after an empty line, you should explain in more detail what the command | |
* does. You might also give some usage example. | |
* | |
* It is important to document the parameters with param tags, because that information will also appear in the help | |
* screen. | |
* | |
* @return void | |
*/ | |
public function testCommand() { | |
$site = $this->siteRepository->findAll()->getFirst(); | |
$this->outputLine('Wait 12 seconds, then persist'); | |
sleep(12); | |
$domain = new Domain(); | |
$domain->setSite($site); | |
$domain->setHostPattern('katze.de'); | |
$this->domainRepository->add($domain); | |
$this->persistenceManager->persistAll(); | |
$this->outputLine('Persistet.'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment