Skip to content

Instantly share code, notes, and snippets.

@jp1987
Forked from agitso/CliEmailService.php
Created February 28, 2013 13:02
Show Gist options
  • Save jp1987/5056567 to your computer and use it in GitHub Desktop.
Save jp1987/5056567 to your computer and use it in GitHub Desktop.
<?php
...
/**
* @var \TYPO3\Flow\Mvc\Routing\UriBuilder
*/
protected $uriBuilder;
/**
* @param \TYPO3\Flow\Configuration\ConfigurationManager $configurationManager
*/
public function injectUriBuilder(\TYPO3\Flow\Configuration\ConfigurationManager $configurationManager) {
$flowSettings = $configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'TYPO3.Flow');
$httpRequest = \TYPO3\Flow\Http\Request::create(new \TYPO3\Flow\Http\Uri('http://localhost'));
$httpRequest->injectSettings($flowSettings);
$request = new \TYPO3\Flow\Mvc\ActionRequest($httpRequest);
$uriBuilder = new \TYPO3\Flow\Mvc\Routing\UriBuilder();
$uriBuilder->setRequest($request);
$uriBuilder->setCreateAbsoluteUri(TRUE);
$this->uriBuilder = $uriBuilder;
}
...
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment