Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Static Public Member Functions | Public Attributes | Static Private Member Functions | List of all members
eZSiteAccess Class Reference

## Static Public Member Functions
static | siteAccessList ()
static | findPathToSiteAccess ( $siteAccess)
static | match (eZURI $uri, $host, $port=80, $file='/index.php')
static | matchRegexp (&$text, $reg, $num)
static | matchText (&$text, $match_pre, $match_post)
static | reInitialise ()
static | change (array $access, ?eZINI $siteINI=null)
static | load (array $access, ?eZINI $siteINI=null)
static | getIni ( $siteAccess, $settingFile='site.ini')
static | current ()
static | saNameByLanguage ( $language)
static | exists ( $siteAccessName)

## Public Attributes
const | TYPE_DEFAULT = 1
const | TYPE_URI = 2
const | TYPE_PORT = 3
const | TYPE_HTTP_HOST = 4
const | TYPE_INDEX_FILE = 5
const | TYPE_STATIC = 6
const | TYPE_SERVER_VAR = 7
const | TYPE_URL = 8
const | TYPE_HTTP_HOST_URI = 9
const | TYPE_CUSTOM = 10
const | SUBTYPE_PRE = 1
const | SUBTYPE_POST = 2

## Static Private Member Functions
static | washName ( $name)

## Detailed Description

Definition at line 16 of file ezsiteaccess.php.

## Member Function Documentation

## ◆ change()

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 | $access | An associative array with 'name' (string), 'type' (int) and 'uri_part' (array). See eZSiteAccess::match() for array structure definition
  eZINI | null | $siteINI | 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 eZSiteAccess::load())

Returns
  array The $access parameter

Definition at line 503 of file ezsiteaccess.php.

References eZSys\clearAccessPath(), eZContentLanguage\expireCache(), eZExtension\prependExtensionSiteAccesses(), eZSys\setAccessPath(), TYPE_URI, and eZDebugSetting\writeDebug().

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

## ◆ current()

static eZSiteAccess::current | ( |  | ) |
| static

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

Since
  4.4 return array|null

Definition at line 675 of file ezsiteaccess.php.

## ◆ exists()

static eZSiteAccess::exists | ( |  | $siteAccessName | ) |
| static

Checks if $siteAccessName matches a configured siteaccess

Parameters

  $siteAccessName |

Returns
  bool

Definition at line 722 of file ezsiteaccess.php.

References siteAccessList().

## ◆ findPathToSiteAccess()

static eZSiteAccess::findPathToSiteAccess | ( |  | $siteAccess | ) |
| static

Returns path to site access

Parameters

  string | $siteAccess |

Returns
  string|false Return path to siteacces or false if invalid

Definition at line 66 of file ezsiteaccess.php.

References eZExtension\activeExtensions(), and eZExtension\baseDirectory().

## ◆ getIni()

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

Definition at line 631 of file ezsiteaccess.php.

References load(), and TYPE_STATIC.

Referenced by eZStaticCache\buildCacheDirPart().

## ◆ load()

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()

- clears all in-memory caches used by the INI system
- re-builds the list of paths where INI files are searched for
- runs eZSiteAccess::change()
- re-searches module paths eZModule::setGlobalPathList()

Since
  4.4

Parameters

  array | $access | An associative array with 'name' (string), 'type' (int) and 'uri_part' (array). See eZSiteAccess::match() for array structure definition
  eZINI | null | $siteINI | 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.

Returns
  array The $access parameter

Definition at line 585 of file ezsiteaccess.php.

References eZExtension\activateExtensions(), eZModule\activeModuleRepositories(), change(), eZExtension\clearActiveExtensionsMemoryCache(), eZTemplateDesignResource\clearInMemoryCache(), and eZModule\setGlobalPathList().

Referenced by eZContentCacheManager\generateObjectViewCache(), getIni(), and reInitialise().

## ◆ match()

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 | $file | Example '/index.php'

Returns
  array

Definition at line 103 of file ezsiteaccess.php.

References eZExecution\cleanExit(), eZURI\dropBase(), eZURI\element(), eZURI\elements(), eZURI\encodeIRI(), eZURI\increase(), eZSys\indexDir(), matchRegexp(), matchText(), eZSys\serverVariable(), eZURI\setURIString(), TYPE_DEFAULT, TYPE_HTTP_HOST, TYPE_HTTP_HOST_URI, TYPE_INDEX_FILE, TYPE_PORT, TYPE_SERVER_VAR, TYPE_STATIC, TYPE_URI, washName(), eZDebugSetting\writeDebug(), and eZDebug\writeError().

## ◆ matchRegexp()

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

Match a regex expression

Since
  4.4

Parameters

  string | $text |
  string | $reg |
  int | $num |

Returns
  string|null

Definition at line 428 of file ezsiteaccess.php.

Referenced by match().

## ◆ matchText()

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

Definition at line 448 of file ezsiteaccess.php.

Referenced by match().

## ◆ reInitialise()

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

Definition at line 478 of file ezsiteaccess.php.

References load().

## ◆ saNameByLanguage()

static eZSiteAccess::saNameByLanguage | ( |  | $language | ) |
| static

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.

Since
  4.5

Parameters

  string | $language | eg: eng-GB

Returns
  string|null

Definition at line 691 of file ezsiteaccess.php.

References eZDebug\writeWarning().

## ◆ siteAccessList()

static eZSiteAccess::siteAccessList | ( |  | ) |
| static

Definition at line 37 of file ezsiteaccess.php.

References eZSys\ezcrc32(), and eZSys\serverVariable().

Referenced by exists().

## ◆ washName()

static eZSiteAccess::washName | ( |  | $name | ) |
| static private

Washes site access name

Allowed characters are [a-z], [A-Z] and [0-9], and the "_" (underscore). The washing rules are:

- Characters not in the previous list (alphanumerical and underscore) are replaced by an "_" (underscore);
- Multiple consecutive "_" (underscores) are replaced by a single underscore;
- Leading and trailing "_" are removed.

Since
  5.3

Parameters

  string | $name | The site access name, as received from the browser

Returns
  string The washed name

Definition at line 560 of file ezsiteaccess.php.

Referenced by match().

## Member Data Documentation

## ◆ SUBTYPE_POST

const eZSiteAccess::SUBTYPE_POST = 2

Definition at line 35 of file ezsiteaccess.php.

## ◆ SUBTYPE_PRE

const eZSiteAccess::SUBTYPE_PRE = 1

Definition at line 34 of file ezsiteaccess.php.

## ◆ TYPE_CUSTOM

const eZSiteAccess::TYPE_CUSTOM = 10

Definition at line 32 of file ezsiteaccess.php.

## ◆ TYPE_DEFAULT

const eZSiteAccess::TYPE_DEFAULT = 1

Integer constants that identify the siteaccess matching used

Since
  4.4

Definition at line 23 of file ezsiteaccess.php.

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

## ◆ TYPE_HTTP_HOST

const eZSiteAccess::TYPE_HTTP_HOST = 4

Definition at line 26 of file ezsiteaccess.php.

Referenced by match().

## ◆ TYPE_HTTP_HOST_URI

const eZSiteAccess::TYPE_HTTP_HOST_URI = 9

Definition at line 31 of file ezsiteaccess.php.

Referenced by match().

## ◆ TYPE_INDEX_FILE

const eZSiteAccess::TYPE_INDEX_FILE = 5

Definition at line 27 of file ezsiteaccess.php.

Referenced by match().

## ◆ TYPE_PORT

const eZSiteAccess::TYPE_PORT = 3

Definition at line 25 of file ezsiteaccess.php.

Referenced by match().

## ◆ TYPE_SERVER_VAR

const eZSiteAccess::TYPE_SERVER_VAR = 7

Definition at line 29 of file ezsiteaccess.php.

Referenced by match().

## ◆ TYPE_STATIC

const eZSiteAccess::TYPE_STATIC = 6

Definition at line 28 of file ezsiteaccess.php.

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

## ◆ TYPE_URI

const eZSiteAccess::TYPE_URI = 2

Definition at line 24 of file ezsiteaccess.php.

Referenced by change(), eZNodeviewfunctions\generateViewCacheFile(), and match().

## ◆ TYPE_URL

const eZSiteAccess::TYPE_URL = 8

Definition at line 30 of file ezsiteaccess.php.

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

- ezsiteaccess.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.