kernel/classes/ezsiteaccess.php
File containing (site)access functionality
- Copyright
- Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.
- License
- eZ Business Use License Agreement Version 2.0
- Package
- kernel
- Version
- 4.6.0
\eZSiteAccess
Provides functions for siteaccess handling
Constants

TYPE_DEFAULT
= 1
Integer constants that identify the siteaccess matching used
- Since
- 4.4 Was earlier in access.php as normal constants
Methods


change(
array $access, \eZINI | null $siteINI
=
null
)
:
array
Changes the site access to what's defined in $access. It will change the access path in eZSys and prepend an override dir to eZINI Note: does not load extensions, use {@link eZSiteAccess::load()} if you want that
Name | Type | Description |
---|---|---|
$access | array | An associative array with 'name' (string), 'type' (int) and 'uri_part' (array). See {@link eZSiteAccess::match()} for array structure definition |
$siteINI | \eZINI | null | Optional parameter to be able to only do change on specific instance of site.ini hence skip changing eZSys access paths (but not siteaccess, see {@link eZSiteAccess::load()}) |
Type | Description |
---|---|
array | The $access parameter |
- Since
- 4.4


current(
)
:
void
Get current siteaccess data if set, see {@link eZSiteAccess::match()} for array structure
- Since
- 4.4 return array|null


debugEnabled(
)
:
bool
Checks if site access debug is enabled
Type | Description |
---|---|
bool |
- Deprecated
- Should use debug.ini conditions instead of extra settings
- Since
- 4.4


extraDebugEnabled(
)
:
bool
Checks if extra site access debug is enabled
Type | Description |
---|---|
bool |
- Deprecated
- Should use debug.ini conditions instead of extra settings
- Since
- 4.4


findPathToSiteAccess(
string $siteAccess
)
:
string | false
Returns path to site access
Name | Type | Description |
---|---|---|
$siteAccess | string |
Type | Description |
---|---|
string | false | Return path to siteacces or false if invalid |


getIni(
string $siteAccess, string $settingFile
=
'site.ini'
)
:
\eZINI
Loads ini environment for a specific siteaccess
eg: $ini = eZSiteAccess::getIni( 'eng', 'site.ini' );
Name | Type | Description |
---|---|---|
$siteAccess | string | |
$settingFile | string |
Type | Description |
---|---|
\eZINI |
- Since
- 4.4


load(
array $access, \eZINI | null $siteINI
=
null
)
:
array
Reloads extensions and changes siteaccess globally If you only want changes on a instance of ini, use {@link eZSiteAccess::getIni()}
- clears all in-memory caches used by the INI system
- re-builds the list of paths where INI files are searched for
- runs {@link eZSiteAccess::change()}
- re-searches module paths {@link eZModule::setGlobalPathList()}
Name | Type | Description |
---|---|---|
$access | array | An associative array with 'name' (string), 'type' (int) and 'uri_part' (array). See {@link eZSiteAccess::match()} for array structure definition |
$siteINI | \eZINI | null | Optional parameter to be able to only do change on specific instance of site.ini If set, then global siteacceess will not be changed as well. |
Type | Description |
---|---|
array | The $access parameter |
- Since
- 4.4


match(
\eZURI $uri, string $host, \string(numeric) $port
=
80, string $file
=
'/index.php'
)
:
array
Goes trough the access matching rules and returns the access match.
The returned match is an associative array with: name => string Name of the siteaccess (same as folder name) type => int The constant that represent the matching used uri_part => array(string) List of path elements that was used in start of url for the match
Name | Type | Description |
---|---|---|
$uri | \eZURI | |
$host | string | |
$port | \string(numeric) | |
$file | string | Example '/index.php' |
Type | Description |
---|---|
array |
- Since
- 4.4


matchRegexp(
string $text, string $reg, int $num
)
:
string | null
Match a regex expression
Name | Type | Description |
---|---|---|
$text | string | |
$reg | string | |
$num | int |
Type | Description |
---|---|
string | null |
- Since
- 4.4


matchText(
string $text, string $match_pre, string $match_post
)
:
string | null
Match a text string with pre or/or post text strings
Name | Type | Description |
---|---|---|
$text | string | |
$match_pre | string | |
$match_post | string |
Type | Description |
---|---|
string | null |
- Since
- 4.4


reInitialise(
)
:
bool
Re-initialises the current site access If a siteaccess is set, then executes {@link eZSiteAccess::load()}
Type | Description |
---|---|
bool | True if re-initialisation was successful |


saNameByLanguage(
string $language
)
:
string | null
Gets siteaccess name by language based on site.ini\[RegionalSettings]\LanguageSA[] if defined otherwise by convention ( eng-GB -> eng ), in both cases sa needs to be in site.ini\[SiteAccessSettings]\RelatedSiteAccessList[] as well to be valid.
Name | Type | Description |
---|---|---|
$language | string | eg: eng-GB |
Type | Description |
---|---|
string | null |
- Since
- 4.5