本文整理汇总了PHP中TYPO3\Flow\Object\ObjectManagerInterface::getContext方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectManagerInterface::getContext方法的具体用法?PHP ObjectManagerInterface::getContext怎么用?PHP ObjectManagerInterface::getContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Object\ObjectManagerInterface
的用法示例。
在下文中一共展示了ObjectManagerInterface::getContext方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Returns the HTML needed to include ExtJS, that is, CSS and JS includes.
*
* = Examples =
*
* <code title="Simple">
* {namespace ext=TYPO3\ExtJS\ViewHelpers}
* ...
* <ext:include/>
* </code>
* Renders the script and link tags needed to include everything needed to
* use ExtJS.
*
* <code title="Use a specific theme">
* <ext:include theme="xtheme-gray"/>
* </code>
*
* @param string $theme The theme to include, simply the name of the CSS
* @param boolean $debug Whether to use the debug version of ExtJS
* @param boolean $includeStylesheets Include ExtJS CSS files if true
* @return string HTML needed to include ExtJS
* @api
*/
public function render($theme = 'xtheme-blue', $debug = NULL, $includeStylesheets = TRUE)
{
if ($debug === NULL) {
$debug = $this->objectManager->getContext()->isDevelopment() ?: FALSE;
}
$baseUri = $this->resourcePublisher->getStaticResourcesWebBaseUri() . 'Packages/TYPO3.ExtJS/';
$output = '';
if ($includeStylesheets) {
$output .= '
<link rel="stylesheet" href="' . $baseUri . 'CSS/ext-all-notheme.css" />
<link rel="stylesheet" href="' . $baseUri . 'CSS/' . $theme . '.css" />';
}
if ($debug) {
$output .= '
<script type="text/javascript" src="' . $baseUri . 'JavaScript/adapter/ext/ext-base-debug.js"></script>
<script type="text/javascript" src="' . $baseUri . 'JavaScript/ext-all-debug.js"></script>';
} else {
$output .= '
<script type="text/javascript" src="' . $baseUri . 'JavaScript/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="' . $baseUri . 'JavaScript/ext-all.js"></script>';
}
$output .= '
<script type="text/javascript">
Ext.BLANK_IMAGE_URL = \'' . $baseUri . 'images/default/s.gif\';
Ext.FlashComponent.EXPRESS_INSTALL_URL = \'' . $baseUri . 'Flash/expressinstall.swf\';
Ext.chart.Chart.CHART_URL = \'' . $baseUri . 'Flash/chart.swf\';
</script>
';
return $output;
}
示例2: initializeObject
/**
* @return void
*/
public function initializeObject()
{
// flush routing caches if in Development context & routing settings changed
if ($this->objectManager->getContext()->isDevelopment() && $this->routeCache->get('routingSettings') !== $this->routingSettings) {
$this->flushCaches();
$this->routeCache->set('routingSettings', $this->routingSettings);
}
}
示例3: preToolbarRendering
/**
* TODO: Document this Method! ( assignVariables )
*/
public function preToolbarRendering()
{
$memoryUsage = memory_get_peak_usage(TRUE) / 1024 / 1024;
$memoryUsage = number_format($memoryUsage, 1) . ' MB';
\Debug\Toolbar\Service\Collector::getModule('Environment')->getToolbar()->addIcon('info-sign')->addText($memoryUsage)->getPopup()->addTable(array('PHP Version' => PHP_VERSION, 'Flow Context' => $this->objectManager->getContext(), 'Flow Version' => FLOW_VERSION_BRANCH))->getPanel()->addTable(array('PHP Version' => PHP_VERSION, 'Flow Context' => $this->objectManager->getContext(), 'Flow Version' => FLOW_VERSION_BRANCH));
return;
#$configurations = array();
#foreach ($configurations as $configurationName => $configurationConstant) {
# $configuration = $this->configurationManager->getConfiguration($configurationConstant);
# $configurations[$configurationName] = \Symfony\Component\Yaml\Yaml::dump($configuration, 10);
#}
#$configurations["Constants"] = \Symfony\Component\Yaml\Yaml::dump(get_defined_constants(), 10);
#$this->view->assign('configurations', $configurations);
}
示例4: getSubProcess
/**
* @return SubProcess
*/
protected function getSubProcess()
{
if ($this->subProcess === NULL) {
/** @var CacheManager $cacheManager */
$cacheManager = $this->objectManager->get('TYPO3\\Flow\\Cache\\CacheManager');
if ($cacheManager->hasCache('Flow_Security_Policy_Privilege_Method')) {
$cacheManager->getCache('Flow_Security_Policy_Privilege_Method')->flush();
}
$objectConfigurationCache = $cacheManager->getCache('Flow_Object_Configuration');
$objectConfigurationCache->remove('allAspectClassesUpToDate');
$objectConfigurationCache->remove('allCompiledCodeUpToDate');
$cacheManager->getCache('Flow_Object_Classes')->flush();
$this->subProcess = new SubProcess($this->objectManager->getContext());
}
return $this->subProcess;
}
示例5: callRenderMethod
/**
* Call the render() method and handle errors.
*
* @return string the rendered ViewHelper
* @throws Exception
*/
protected function callRenderMethod()
{
$renderMethodParameters = array();
/** @var $argumentDefinition ArgumentDefinition */
foreach ($this->argumentDefinitions as $argumentName => $argumentDefinition) {
if ($argumentDefinition->isMethodParameter()) {
$renderMethodParameters[$argumentName] = $this->arguments[$argumentName];
}
}
try {
return call_user_func_array(array($this, 'render'), $renderMethodParameters);
} catch (Exception $exception) {
if (!$this->objectManager->getContext()->isProduction()) {
throw $exception;
} else {
$this->systemLogger->log('An Exception was captured: ' . $exception->getMessage() . '(' . $exception->getCode() . ')', LOG_ERR, 'TYPO3.Fluid', get_class($this));
return '';
}
}
}
示例6: handle
/**
* @param ComponentContext $componentContext
* @return void
*/
public function handle(ComponentContext $componentContext)
{
$httpResponse = $componentContext->getHttpResponse();
$httpResponse->setHeader($this->options['headerName'], $this->objectManager->getContext()->__toString());
}