eZPublishCommunityProject  2013.9
eZ\Bundle\EzPublishLegacyBundle\DependencyInjection\Configuration\LegacyConfigResolver Class Reference

Configuration resolver for eZ Publish legacy. More...

+ Inheritance diagram for eZ\Bundle\EzPublishLegacyBundle\DependencyInjection\Configuration\LegacyConfigResolver:
+ Collaboration diagram for eZ\Bundle\EzPublishLegacyBundle\DependencyInjection\Configuration\LegacyConfigResolver:

Public Member Functions

 __construct (\Closure $legacyKernelClosure, $defaultNamespace)
 
 getDefaultNamespace ()
 Returns the current default namespace. More...
 
 getGroup ($groupName, $namespace=null, $scope=null)
 Returns values for $groupName, in $namespace. More...
 
 getParameter ($paramName, $namespace=null, $scope=null)
 Returns value for $paramName, in $namespace. More...
 
 hasParameter ($paramName, $namespace=null, $scope=null)
 Checks if $paramName exists in $namespace. More...
 
 setDefaultNamespace ($defaultNamespace)
 Changes the default namespace to look parameter into. More...
 

Protected Member Functions

 getLegacyKernel ()
 

Protected Attributes

 $defaultNamespace
 
 $legacyKernelClosure
 

Detailed Description

Configuration resolver for eZ Publish legacy.

Will help you get settings from the legacy kernel (old ini files).

// From a controller $legacyResolver = $this->container->get( 'ezpublish_legacy.config.resolver' ); // Get [DebugSettings].DebugOutput from site.ini $debugOutput = $legacyResolver->getParameter( 'DebugSettings.DebugOutput' ); // Get [ImageMagick].ExecutablePath from image.ini $imageMagickPath = $legacyResolver->getParameter( 'ImageMagick.ExecutablePath', 'image' ); // Get [DatabaseSettings].Database from site.ini, for ezdemo_site_admin siteaccess $databaseName = $legacyResolver->getParameter( 'DatabaseSettings.Database', 'site', 'ezdemo_site_admin' );

// Note that the examples above are also applicable for hasParameter().

Constructor & Destructor Documentation

eZ\Bundle\EzPublishLegacyBundle\DependencyInjection\Configuration\LegacyConfigResolver::__construct ( \Closure  $legacyKernelClosure,
  $defaultNamespace 
)

Member Function Documentation

eZ\Bundle\EzPublishLegacyBundle\DependencyInjection\Configuration\LegacyConfigResolver::getDefaultNamespace ( )

Returns the current default namespace.

Returns
string

Implements eZ\Publish\Core\MVC\ConfigResolverInterface.

eZ\Bundle\EzPublishLegacyBundle\DependencyInjection\Configuration\LegacyConfigResolver::getGroup (   $groupName,
  $namespace = null,
  $scope = null 
)

Returns values for $groupName, in $namespace.

Parameters
string$groupNameString containing an INI group name.
string$namespaceThe legacy INI file name, without the suffix (i.e. without ".ini").
string$scopeA specific siteaccess to look into. Defaults to the current siteaccess.
Exceptions
\eZ\Publish\Core\MVC\Exception\ParameterNotFoundException
Todo:
Implement in ConfigResolver interface
Returns
array
eZ\Bundle\EzPublishLegacyBundle\DependencyInjection\Configuration\LegacyConfigResolver::getParameter (   $paramName,
  $namespace = null,
  $scope = null 
)

Returns value for $paramName, in $namespace.

Parameters
string$paramNameString containing dot separated INI group name and param name. Must follow the following format: <iniGroupName>.<paramName>
string$namespaceThe legacy INI file name, without the suffix (i.e. without ".ini").
string$scopeA specific siteaccess to look into. Defaults to the current siteaccess.
Exceptions
\eZ\Publish\Core\MVC\Exception\ParameterNotFoundException
Returns
mixed

Implements eZ\Publish\Core\MVC\ConfigResolverInterface.

eZ\Bundle\EzPublishLegacyBundle\DependencyInjection\Configuration\LegacyConfigResolver::hasParameter (   $paramName,
  $namespace = null,
  $scope = null 
)

Checks if $paramName exists in $namespace.

Parameters
string$paramName
string$namespaceIf null, the default namespace should be used.
string$scopeThe scope you need $paramName value for.
Returns
boolean

Implements eZ\Publish\Core\MVC\ConfigResolverInterface.

eZ\Bundle\EzPublishLegacyBundle\DependencyInjection\Configuration\LegacyConfigResolver::setDefaultNamespace (   $defaultNamespace)

Changes the default namespace to look parameter into.

Parameters
string$defaultNamespace

Implements eZ\Publish\Core\MVC\ConfigResolverInterface.

Member Data Documentation

eZ\Bundle\EzPublishLegacyBundle\DependencyInjection\Configuration\LegacyConfigResolver::$legacyKernelClosure
protected

The documentation for this class was generated from the following file: