eZPublishCommunityProject(LegacyStack)  2013.5
eZSiteAccess Class Reference

Public Member Functions

 eZSiteAccess ()
 

Static Public Member Functions

static change (array $access, eZINI $siteINI=null)
 Changes the site access to what's defined in $access. More...
 
static current ()
 Get current siteaccess data if set, see eZSiteAccess::match() for array structure. More...
 
static findPathToSiteAccess ($siteAccess)
 Returns path to site access. More...
 
static getIni ($siteAccess, $settingFile= 'site.ini')
 Loads ini environment for a specific siteaccess. More...
 
static load (array $access, eZINI $siteINI=null)
 Reloads extensions and changes siteaccess globally If you only want changes on a instance of ini, use eZSiteAccess::getIni(). More...
 
static match (eZURI $uri, $host, $port=80, $file= '/index.php')
 Goes trough the access matching rules and returns the access match. More...
 
static matchRegexp (&$text, $reg, $num)
 Match a regex expression. More...
 
static matchText (&$text, $match_pre, $match_post)
 Match a text string with pre or/or post text strings. More...
 
static reInitialise ()
 Re-initialises the current site access If a siteaccess is set, then executes eZSiteAccess::load(). More...
 
static saNameByLanguage ($language)
 Gets siteaccess name by language based on site.ini[RegionalSettings][] if defined otherwise by convention ( eng-GB -> eng ), in both cases sa needs to be in site.ini[SiteAccessSettings][] as well to be valid. More...
 
static siteAccessList ()
 

Public Attributes

const SUBTYPE_POST = 2
 
const SUBTYPE_PRE = 1
 
const TYPE_CUSTOM = 10
 
const TYPE_DEFAULT = 1
 Integer constants that identify the siteaccess matching used. More...
 
const TYPE_HTTP_HOST = 4
 
const TYPE_HTTP_HOST_URI = 9
 
const TYPE_INDEX_FILE = 5
 
const TYPE_PORT = 3
 
const TYPE_SERVER_VAR = 7
 
const TYPE_STATIC = 6
 
const TYPE_URI = 2
 
const TYPE_URL = 8
 

Member Function Documentation

static eZSiteAccess::change ( array  $access,
eZINI  $siteINI = null 
)
static

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 eZSiteAccess::load() if you want that

Since
4.4
Parameters
array$accessAn associative array with 'name' (string), 'type' (int) and 'uri_part' (array). See eZSiteAccess::match() for array structure definition
eZINI | null$siteINIOptional parameter to be able to only do change on specific instance of site.ini hence skip changing eZSys access paths (but not siteaccess, see eZSiteAccess::load())
Returns
array The $access parameter

Referenced by ezpKernelTreeMenu\__construct(), ezpKernelWeb\__construct(), eZScript\initialize(), ezpKernelWeb\requestInit(), and eZWebDAVContentBackend\setCurrentSite().

static eZSiteAccess::current ( )
static

Get current siteaccess data if set, see eZSiteAccess::match() for array structure.

Since
4.4 return array|null

Referenced by ezpMultivariateTestHandler\execute(), ezpMobileDeviceRegexpFilter\redirect(), and ezpKernelWeb\requestInit().

eZSiteAccess::eZSiteAccess ( )

Constructor

static eZSiteAccess::findPathToSiteAccess (   $siteAccess)
static

Returns path to site access.

Parameters
string$siteAccess
Returns
string|false Return path to siteacces or false if invalid

Referenced by eZINI\getSiteAccessIni(), and removeRelatedCache().

static eZSiteAccess::getIni (   $siteAccess,
  $settingFile = 'site.ini' 
)
static

Loads ini environment for a specific siteaccess.

eg: $ini = eZSiteAccess::getIni( 'eng', 'site.ini' );

Since
4.4
Parameters
string$siteAccess
string$settingFile
Returns
eZINI

Referenced by eZStaticCache\buildCacheDirPart(), ezpLanguageSwitcher\getSiteAccessIni(), and ezpLanguageSwitcher\setupTranslationSAList().

static eZSiteAccess::load ( array  $access,
eZINI  $siteINI = null 
)
static

Reloads extensions and changes siteaccess globally If you only want changes on a instance of ini, use eZSiteAccess::getIni().

Since
4.4
Parameters
array$accessAn associative array with 'name' (string), 'type' (int) and 'uri_part' (array). See eZSiteAccess::match() for array structure definition
eZINI | null$siteINIOptional 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.
Returns
array The $access parameter

Referenced by eZContentCacheManager\generateObjectViewCache().

static eZSiteAccess::match ( eZURI  $uri,
  $host,
  $port = 80,
  $file = '/index.php' 
)
static

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

Since
4.4
Parameters
eZURI$uri
string$host
string(numeric)$port
string$fileExample '/index.php'
Returns
array

Referenced by ezpKernelTreeMenu\__construct(), and ezpKernelWeb\__construct().

static eZSiteAccess::matchRegexp ( $text,
  $reg,
  $num 
)
static

Match a regex expression.

Since
4.4
Parameters
string$text
string$reg
int$num
Returns
string|null
static eZSiteAccess::matchText ( $text,
  $match_pre,
  $match_post 
)
static

Match a text string with pre or/or post text strings.

Since
4.4
Parameters
string$text
string$match_pre
string$match_post
Returns
string|null
static eZSiteAccess::reInitialise ( )
static

Re-initialises the current site access If a siteaccess is set, then executes eZSiteAccess::load().

Returns
bool True if re-initialisation was successful
static eZSiteAccess::saNameByLanguage (   $language)
static

Gets siteaccess name by language based on site.ini[RegionalSettings][] if defined otherwise by convention ( eng-GB -> eng ), in both cases sa needs to be in site.ini[SiteAccessSettings][] as well to be valid.

Since
4.5
Parameters
string$languageeg: eng-GB
Returns
string|null
static eZSiteAccess::siteAccessList ( )
static

Member Data Documentation

const eZSiteAccess::SUBTYPE_POST = 2
const eZSiteAccess::SUBTYPE_PRE = 1
const eZSiteAccess::TYPE_CUSTOM = 10
const eZSiteAccess::TYPE_DEFAULT = 1

Integer constants that identify the siteaccess matching used.

Since
4.4

Referenced by eZScript\initialize(), and match().

const eZSiteAccess::TYPE_HTTP_HOST = 4

Referenced by match().

const eZSiteAccess::TYPE_HTTP_HOST_URI = 9

Referenced by match().

const eZSiteAccess::TYPE_INDEX_FILE = 5

Referenced by match().

const eZSiteAccess::TYPE_PORT = 3

Referenced by match().

const eZSiteAccess::TYPE_SERVER_VAR = 7

Referenced by match().

const eZSiteAccess::TYPE_STATIC = 6
const eZSiteAccess::TYPE_URL = 8

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