本文整理汇总了PHP中TYPO3\Flow\Configuration\ConfigurationManager::getConfiguration方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigurationManager::getConfiguration方法的具体用法?PHP ConfigurationManager::getConfiguration怎么用?PHP ConfigurationManager::getConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Configuration\ConfigurationManager
的用法示例。
在下文中一共展示了ConfigurationManager::getConfiguration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializeObject
/**
* Called by the Flow object framework after creating the object and resolving all dependencies.
*
* @param integer $cause Creation cause
*/
public function initializeObject($cause)
{
if ($cause === \TYPO3\Flow\Object\ObjectManagerInterface::INITIALIZATIONCAUSE_CREATED) {
$settings = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'TYPO3.TYPO3CR.Search');
$this->indexName = $settings['elasticSearch']['indexName'];
}
}
开发者ID:kdambekalns,项目名称:Flowpack.ElasticSearch.ContentRepositoryAdaptor,代码行数:12,代码来源:ElasticSearchClient.php
示例2: addDynamicNodeConfiguration
/**
* This aspect will block loadNodeTypes from being called and will instead
* call overrideNodeTypes with a modified configuration.
*
* @Flow\Around("method(TYPO3\TYPO3CR\Domain\Service\NodeTypeManager->loadNodeTypes())")
* @param JoinPointInterface $joinPoint The current join point
* @return void
*/
public function addDynamicNodeConfiguration(JoinPointInterface $joinPoint)
{
$completeNodeTypeConfiguration = $this->configurationManager->getConfiguration('NodeTypes');
$dynamicNodeTypes = $this->dynamicNodeTypeRepository->findAll();
/* @var $dynamicNodeType DynamicNodeType */
foreach ($dynamicNodeTypes as $dynamicNodeType) {
$dynamicNodeName = $dynamicNodeType->getValidNodeTypeName($this->settings['nodeNamespace']);
if (!array_key_exists($dynamicNodeName, $completeNodeTypeConfiguration)) {
$dynamicProperties = array();
/* @var $dynamicProperty DynamicProperty */
foreach ($dynamicNodeType->getDynamicProperties() as $dynamicProperty) {
$dynamicPropertyName = $dynamicProperty->getValidPropertyName($this->settings['propertyPrefix']);
$dynamicProperties[$dynamicPropertyName] = array('type' => 'string', 'defaultValue' => $dynamicProperty->getDefaultValue(), 'ui' => array('label' => $dynamicProperty->getLabel(), 'reloadIfChanged' => TRUE, 'inlineEditable' => TRUE, 'aloha' => array('placeholder' => $dynamicProperty->getPlaceholder()), 'inspector' => array('group' => 'dynamicProperties', 'editorOptions' => array('placeholder' => $dynamicProperty->getPlaceholder()))));
}
$newNodeConfiguration = array('superTypes' => $this->settings['superTypes'], 'abstract' => FALSE, 'ui' => array('label' => $dynamicNodeType->getLabel()));
// Only set properties if there are any.
// If properties is set to an empty array a bug in Neos will break the node configuration.
// This leads to an empty inspector and strange error messages.
if (count($dynamicProperties)) {
$newNodeConfiguration['properties'] = $dynamicProperties;
}
$completeNodeTypeConfiguration[$dynamicNodeName] = $newNodeConfiguration;
}
}
/* @var $nodeTypeManager NodeTypeManager */
$nodeTypeManager = $joinPoint->getProxy();
$nodeTypeManager->overrideNodeTypes($completeNodeTypeConfiguration);
}
示例3: initializeObject
/**
* Gets the authentication provider configuration needed
*
* @return void
*/
public function initializeObject()
{
$settings = $this->configurationManager->getConfiguration(\TYPO3\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'TYPO3.Flow');
if (isset($settings['security']['authentication']['providers']['Typo3SetupProvider']['providerOptions']['keyName'])) {
$this->keyName = $settings['security']['authentication']['providers']['Typo3SetupProvider']['providerOptions']['keyName'];
}
}
示例4: initializeObject
/**
* Called by the Flow object framework after creating the object and resolving all dependencies.
*
* @param integer $cause Creation cause
*/
public function initializeObject($cause)
{
if ($cause === \TYPO3\Flow\Object\ObjectManagerInterface::INITIALIZATIONCAUSE_CREATED) {
$settings = $this->configurationManager->getConfiguration(\TYPO3\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'TYPO3.TYPO3CR.Search');
$this->defaultConfigurationPerType = $settings['defaultConfigurationPerType'];
}
}
开发者ID:kdambekalns,项目名称:Flowpack.ElasticSearch.ContentRepositoryAdaptor,代码行数:12,代码来源:NodeTypeMappingBuilder.php
示例5: getSettings
/**
* Get package settings
*/
public function getSettings()
{
if (!is_array($this->settings)) {
$this->settings = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Ttree.JobButler');
}
return $this->settings;
}
示例6: getViewConfiguration
/**
* This method walks through the view configuration and applies
* matching configurations in the order of their specifity score.
* Possible options are currently the viewObjectName to specify
* a different class that will be used to create the view and
* an array of options that will be set on the view object.
*
* @param \TYPO3\Flow\Mvc\ActionRequest $request
* @return array
*/
public function getViewConfiguration(ActionRequest $request)
{
$cacheIdentifier = $this->createCacheIdentifier($request);
$viewConfiguration = $this->cache->get($cacheIdentifier);
if ($viewConfiguration === false) {
$configurations = $this->configurationManager->getConfiguration('Views');
$requestMatcher = new RequestMatcher($request);
$context = new Context($requestMatcher);
$matchingConfigurations = array();
foreach ($configurations as $order => $configuration) {
$requestMatcher->resetWeight();
if (!isset($configuration['requestFilter'])) {
$matchingConfigurations[$order]['configuration'] = $configuration;
$matchingConfigurations[$order]['weight'] = $order;
} else {
$result = $this->eelEvaluator->evaluate($configuration['requestFilter'], $context);
if ($result === false) {
continue;
}
$matchingConfigurations[$order]['configuration'] = $configuration;
$matchingConfigurations[$order]['weight'] = $requestMatcher->getWeight() + $order;
}
}
usort($matchingConfigurations, function ($configuration1, $configuration2) {
return $configuration1['weight'] > $configuration2['weight'];
});
$viewConfiguration = array();
foreach ($matchingConfigurations as $key => $matchingConfiguration) {
$viewConfiguration = Arrays::arrayMergeRecursiveOverrule($viewConfiguration, $matchingConfiguration['configuration']);
}
$this->cache->set($cacheIdentifier, $viewConfiguration);
}
return $viewConfiguration;
}
示例7: getModelDeclaration
/**
* @param string $modelClassName
* @param array $properties
* @param string $applicationName
* @param array $foundRelations
* @return string
*/
public function getModelDeclaration($modelClassName, array $properties, $applicationName, array &$foundRelations)
{
$globalPropertyIgnoreConfiguration = $this->configurationManager->getConfiguration('Settings', 'Radmiraal.Emberjs.properties._exclude');
$modelGenerationPropertyIgnoreConfiguration = $this->configurationManager->getConfiguration('Settings', 'Radmiraal.Emberjs.applications.' . $applicationName . '.model.ignoredProperties');
$ignoredProperties = array_merge($globalPropertyIgnoreConfiguration ?: array(), $modelGenerationPropertyIgnoreConfiguration ?: array());
$typeMapping = $this->configurationManager->getConfiguration('Settings', 'Radmiraal.Emberjs.applications.' . $applicationName . '.model.typeMapping');
$propertyDefinition = array();
foreach ($properties as $property => $propertyConfiguration) {
if ($property === 'id' || in_array($property, $ignoredProperties) || $this->reflectionService->isPropertyAnnotatedWith($modelClassName, $property, 'TYPO3\\Flow\\Annotations\\Transient')) {
continue;
}
$type = $propertyConfiguration['type'];
if (isset($typeMapping[$type])) {
$type = $typeMapping[$type];
}
if (strpos($propertyConfiguration['type'], '\\')) {
if (!in_array($propertyConfiguration['type'], $foundRelations)) {
$foundRelations[] = $propertyConfiguration['type'];
}
$type = 'App.' . EmberDataUtility::uncamelizeClassName($type);
}
$propertyDefinition[] = sprintf('%s%s: DS.attr("%s")', chr(10) . "\t", $property, !empty($type) ? $type : 'string');
}
$modelName = EmberDataUtility::uncamelizeClassName($modelClassName);
return sprintf('App.%s = DS.Model.extend(App.ModelMixin, {%s%s});', $modelName, implode(',', $propertyDefinition), chr(10)) . chr(10);
}
示例8: getTokenEndpointForProvider
/**
* @param string $providerName The provider name as given in Settings.yaml
* @throws \InvalidArgumentException
* @return TokenEndpointInterface
*/
public function getTokenEndpointForProvider($providerName)
{
$tokenEndpointClassName = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, sprintf('TYPO3.Flow.security.authentication.providers.%s.providerOptions.tokenEndpointClassName', $providerName));
if ($tokenEndpointClassName === NULL) {
throw new \InvalidArgumentException(sprintf('In Settings.yaml, there was no "tokenEndpointClassName" option given for the provider "%s".', $providerName), 1383743372);
}
return $this->objectManager->get($tokenEndpointClassName);
}
示例9: injectConfigurationManager
/**
* Injects the configuration manager
*
* @param \TYPO3\Flow\Configuration\ConfigurationManager $configurationManager
* @return void
*/
public function injectConfigurationManager(\TYPO3\Flow\Configuration\ConfigurationManager $configurationManager)
{
$this->configurationManager = $configurationManager;
$this->matches = $this->configurationManager->getConfiguration(\TYPO3\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'Debug.Profiling.Classes');
foreach ($this->matches as $key => $value) {
$this->matches[$key] = '/^' . str_replace('\\', '\\\\', $value) . '$/';
}
}
示例10: handle
/**
* Resolve a route for the request
*
* Stores the resolved route values in the ComponentContext to pass them
* to other components. They can be accessed via ComponentContext::getParameter('TYPO3\Flow\Mvc\Routing\RoutingComponent', 'matchResults');
*
* @param ComponentContext $componentContext
* @return void
*/
public function handle(ComponentContext $componentContext)
{
if ($componentContext->getParameter('TYPO3\\Flow\\Mvc\\Routing\\RoutingComponent', 'skipRouterInitialization') !== TRUE) {
$routesConfiguration = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_ROUTES);
$this->router->setRoutesConfiguration($routesConfiguration);
}
$matchResults = $this->router->route($componentContext->getHttpRequest());
$componentContext->setParameter('TYPO3\\Flow\\Mvc\\Routing\\RoutingComponent', 'matchResults', $matchResults);
}
示例11: initializeObject
/**
* @return void
*/
public function initializeObject()
{
$this->settings = $this->configurationManager->getConfiguration('Settings', 'TYPO3.Media');
$domain = $this->domainRepository->findOneByActiveRequest();
// Set active asset collection to the current site's asset collection, if it has one, on the first view if a matching domain is found
if ($domain !== null && !$this->browserState->get('activeAssetCollection') && $this->browserState->get('automaticAssetCollectionSelection') !== true && $domain->getSite()->getAssetCollection() !== null) {
$this->browserState->set('activeAssetCollection', $domain->getSite()->getAssetCollection());
$this->browserState->set('automaticAssetCollectionSelection', true);
}
}
示例12: prepareRealtimeIndexing
/**
* @param \TYPO3\Flow\Core\Bootstrap $bootstrap
*/
public function prepareRealtimeIndexing(\TYPO3\Flow\Core\Bootstrap $bootstrap)
{
$this->configurationManager = $bootstrap->getObjectManager()->get('TYPO3\\Flow\\Configuration\\ConfigurationManager');
$settings = $this->configurationManager->getConfiguration(\TYPO3\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, $this->getPackageKey());
if (isset($settings['realtimeIndexing']['enabled']) && $settings['realtimeIndexing']['enabled'] === TRUE) {
$bootstrap->getSignalSlotDispatcher()->connect('Flowpack\\ElasticSearch\\Indexer\\Object\\Signal\\SignalEmitter', 'objectUpdated', 'Flowpack\\ElasticSearch\\Indexer\\Object\\ObjectIndexer', 'indexObject');
$bootstrap->getSignalSlotDispatcher()->connect('Flowpack\\ElasticSearch\\Indexer\\Object\\Signal\\SignalEmitter', 'objectPersisted', 'Flowpack\\ElasticSearch\\Indexer\\Object\\ObjectIndexer', 'indexObject');
$bootstrap->getSignalSlotDispatcher()->connect('Flowpack\\ElasticSearch\\Indexer\\Object\\Signal\\SignalEmitter', 'objectRemoved', 'Flowpack\\ElasticSearch\\Indexer\\Object\\ObjectIndexer', 'removeObject');
}
}
示例13: render
/**
* Renders an HTML tag from a given asset.
*
* @param string $layout
* @param int $columnNo
* @return string
*/
public function render($layout, $columnNo = 1)
{
$settings = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'JohannesSteu.Bootstrap.GridSystem.Layouts');
if (array_key_exists($layout, $settings)) {
if (array_key_exists("col-" . $columnNo, $settings[$layout])) {
return $settings[$layout]["col-" . $columnNo];
}
}
return "";
}
示例14: getGuides
/**
* @return array
*/
protected function getGuides()
{
$out = [];
$chartSettings = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'WMDB.Forger.Charts');
foreach ($chartSettings['Phases'] as $version => $phases) {
foreach ($phases as $phaseName => $dates) {
$out[] = ['fillAlpha' => 0.5, 'date' => $dates['start'], 'toDate' => $dates['end'], 'label' => $phaseName, 'position' => 'top', 'inside' => TRUE, 'fillColor' => $chartSettings['Colors'][$phaseName]];
}
}
return $out;
}
示例15: getConfiguredOptionsByProviderName
/**
* @param string $providerName
* @throws \InvalidArgumentException
* @return array
*/
protected function getConfiguredOptionsByProviderName($providerName)
{
if (!array_key_exists($providerName, $this->providerOptionsByProviderName)) {
$providerOptions = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, sprintf('TYPO3.Flow.security.authentication.providers.%s.providerOptions', $providerName));
if (!is_array($providerOptions)) {
throw new \InvalidArgumentException(sprintf('The given provider name "%s" was not properly defined in the Settings (i.e. being defined and having a "providerOptions" key).', $providerName), 1383739910);
}
$this->providerOptionsByProviderName[$providerName] = $providerOptions;
}
return $this->providerOptionsByProviderName[$providerName];
}