eZPublishCommunityProject(LegacyStack)  2013.5
eZExtension Class Reference

The class eZExtension does. More...

Public Member Functions

 eZExtension ()
 

Static Public Member Functions

static activateExtensions ($extensionType= 'default', eZINI $siteINI=null)
 Will make sure that all extensions that has settings directories are added to the eZINI override list. More...
 
static activeExtensions ($extensionType=false, eZINI $siteINI=null)
 Return an array with activated extensions. More...
 
static baseDirectory (eZINI $siteINI=null)
 return the base directory for extensions More...
 
static clearActiveExtensionsMemoryCache ()
 Clears the active extensions in-memory cache. More...
 
static expandedPathList ($extensionList, $subdirectory=false)
 
static extensionInfo ($extension)
 
static extensionOrdering (array $activeExtensions)
 Returns the provided array reordered with loading order information taken into account. More...
 
static findExtensionType ($parameters, &$out)
 
static getHandlerClass (ezpExtensionOptions $options)
 Returns the correct handler defined in $iniFile configuration file A correct class name for the handler needs to be specified in the ini settings, and the class needs to be present for the autoload system. More...
 
static isExtension ($path)
 
static nameFromPath ($path)
 
static prependExtensionSiteAccesses ($accessName=false, $ini=false, $globalDir=true, $identifier=null, $order=true)
 Prepend extension siteaccesses. More...
 
static prependSiteAccess ($extension, $accessName=false, $ini=false, $globalDir=true, $identifier=null)
 Prepend siteaccess for specified extension. More...
 

Public Attributes

const CACHE_DIR = 'var/cache/'
 

Static Protected Attributes

static $activeExtensionsCache = array()
 

Detailed Description

The class eZExtension does.

Member Function Documentation

static eZExtension::activateExtensions (   $extensionType = 'default',
eZINI  $siteINI = null 
)
static

Will make sure that all extensions that has settings directories are added to the eZINI override list.

Parameters
string$extensionTypeSee eZExtension::activeExtensions(), value of false is deprecated as of 4.4
eZINI | null$siteINIOptional parameter to be able to only do change on specific instance of site.ini

Referenced by ezpKernelTreeMenu\__construct(), ezpKernelWeb\__construct(), eZScript\initialize(), and eZSiteAccess\load().

static eZExtension::activeExtensions (   $extensionType = false,
eZINI  $siteINI = null 
)
static

Return an array with activated extensions.

Note
Default extensions are those who are loaded before a siteaccess are determined while access extensions are loaded after siteaccess is set.
Parameters
bool | string$extensionTypeDecides which extension to include in the list, the follow values are possible:
  • false - Means add both default and access extensions
  • 'default' - Add only default extensions
  • 'access' - Add only access extensions
eZINI | null$siteINIOptional parameter to be able to only do change on specific instance of site.ini
Returns
array

Referenced by eZModule\activeModuleRepositories(), checkSiteaccess(), eZContentUpload\findHandler(), eZSiteAccess\findPathToSiteAccess(), eZDataType\getDBAExtensionFilePath(), eZPaymentGatewayType\loadAndRegisterExtensionGateways(), and prependExtensionSiteAccesses().

static eZExtension::clearActiveExtensionsMemoryCache ( )
static

Clears the active extensions in-memory cache.

Returns
void

Referenced by eZCache\clearActiveExtensions(), and eZSiteAccess\load().

static eZExtension::expandedPathList (   $extensionList,
  $subdirectory = false 
)
static

Generates a list with expanded paths and returns it. The paths are expanded to where the extensions are placed. Optionally a subdirectory of the extension may be set using $subdirectory.

Referenced by eZTemplate\factory(), eZSearch\getEngine(), eZSimpleTagsOperator\initializeIncludes(), eZUserLoginHandler\instance(), and eZCodeMapper\loadTransformationFiles().

static eZExtension::extensionInfo (   $extension)
static

Read extension information. Returns extension information array specified in feature request 9371. ( http://issues.ez.no/9371 )

Parameters
extensionname
Returns
Extension information array. null if extension is not found, or does not contain extension information.

Referenced by getExtensionsInfo().

static eZExtension::extensionOrdering ( array  $activeExtensions)
static

Returns the provided array reordered with loading order information taken into account.

See Also
activeExtensions
Parameters
array$activeExtensionsArray of extensions.
eZExtension::eZExtension ( )

Constructor

static eZExtension::findExtensionType (   $parameters,
$out 
)
static

This is help function for searching for extension code. It will read ini variables defined in $parameters, search trough the specified directories for specific files and set the result in $out.

The $parameters parameter must contain the following entries.

  • ini-name - The name of the ini file which has the settings, must include the .ini suffix.
  • repository-group - The INI group which has the basic repository settings.
  • repository-variable - The INI variable which has the basic repository settings.
  • extension-group - The INI group which has the extension settings.
  • extension-variable - The INI variable which has the extension settings.
  • subdir - A subdir which will be appended to all repositories searched for, can be left out.
  • extension-subdir - A subdir which will be appended to all extension repositories searched for, can be left out.
  • suffix-name - A suffix which will be appended after the file searched for.
  • type-directory - Whether the type has a directory for it's file or not. Default is true.
  • type - The type to look for, it will try to find a file named repository/subdir/type/type-suffix or if type-directory is false repository/subdir/type-suffix. If type is not specified the type-group and type-variable may be used for fetching the current type.
  • type-group - The INI group which has the type setting.
  • type-variable - The INI variable which has the type setting.
  • alias-group - The INI group which defines type aliases, see below.
  • alias-variable - The INI variable which defines type aliases.

Type aliases allows overriding a specific type to use another type handler, this is useful when extensions want to take control of some specific types or you want multiple names (aliases) for one type.

On success the $out parameter will contain:

  • type - The current type used.
  • original-type - The original type, if aliasing was used it may differ from type.
  • found-file-dir - The directory where the type was found.
  • found-file-path - The full path to the type.
  • found-file-name - The filename of the type.
Returns
true if the extension type was found.

Referenced by eZImageAnalyzer\create(), eZShopAccountHandler\instance(), eZConfirmOrderHandler\instance(), and eZBinaryFile\metaData().

static eZExtension::isExtension (   $path)
static
Returns
true if this path is related to some extension.
Parameters
$pathPath to check.
Note
The root of an extension is considered to be in this path too.
static eZExtension::nameFromPath (   $path)
static

eZExtension::nameFromPath( FILE ) executed in any file of an extension can help you to find the path to additional resources

Returns
Name of the extension a path belongs to.
Parameters
$pathPath to check.

Referenced by isExtension().

static eZExtension::prependExtensionSiteAccesses (   $accessName = false,
  $ini = false,
  $globalDir = true,
  $identifier = null,
  $order = true 
)
static

Prepend extension siteaccesses.

Parameters
string | false$accessNameOptional access name, will use global if false
eZINI | false | null$ini
true$globalDir
string|false|nullSee eZExtension::prependSiteAccess()
bool$orderPrepend extensions in reverse order by setting this to false

Referenced by eZSiteAccess\change(), changeSiteAccessSetting(), and eZINI\findInputFiles().

static eZExtension::prependSiteAccess (   $extension,
  $accessName = false,
  $ini = false,
  $globalDir = true,
  $identifier = null 
)
static

Prepend siteaccess for specified extension.

Parameters
string$extensionName of extension (folder name)
string | false$accessNameOptional access name, will use global if false
eZINI | false | null$ini
true$globalDir
string | false | null$identifierBy setting to string "siteaccess" only one location is supported (identifier makes eZINI overwrite earlier prepends with same key) null(default) means "ext-siteaccess:$extension" is used to only have one pr extension

Member Data Documentation

eZExtension::$activeExtensionsCache = array()
staticprotected
const eZExtension::CACHE_DIR = 'var/cache/'

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