Exponential Basic 2.4.0.1 Exponential Basic 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 17 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 504 of file ezsiteaccess.php.

References $access, $ini, $name, eZSys\clearAccessPath(), eZContentLanguage\expireCache(), eZUpdateDebugSettings(), eZExtension\prependExtensionSiteAccesses(), eZSys\setAccessPath(), TYPE_URI, and eZDebugSetting\writeDebug().

Referenced by ezpbKernelAdmin\__construct(), ezpbKernelWeb\__construct(), ezpKernelTreeMenu\__construct(), ezpKernelWeb\__construct(), ezpKernelRest\__construct(), load(), ezpbKernelAdmin\requestInit(), ezpbKernelWeb\requestInit(), ezpKernelWeb\requestInit(), and eZWebDAVContentBackend\setCurrentSite().

## ◆ 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 676 of file ezsiteaccess.php.

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

## ◆ exists()

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

Checks if $siteAccessName matches a configured siteaccess

Parameters

  $siteAccessName |

Returns
  bool

Definition at line 723 of file ezsiteaccess.php.

References siteAccessList().

Referenced by ezpKernelRest\__construct().

## ◆ 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 67 of file ezsiteaccess.php.

References $ini, eZExtension\activeExtensions(), eZExtension\baseDirectory(), and file_exists().

## ◆ 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 632 of file ezsiteaccess.php.

References $access, $ini, load(), and TYPE_STATIC.

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

## ◆ 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 586 of file ezsiteaccess.php.

References $access, eZExtension\activateExtensions(), change(), and eZExtension\clearActiveExtensionsMemoryCache().

Referenced by 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 104 of file ezsiteaccess.php.

References $access, $elements, $file, $ini, $location, $name, $order, $type, $uri, eZExecution\cleanExit(), eZURI\encodeIRI(), eZSys\indexDir(), matchRegexp(), matchText(), eZSys\serverVariable(), 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().

Referenced by ezpbKernelAdmin\__construct(), ezpbKernelWeb\__construct(), ezpKernelTreeMenu\__construct(), ezpKernelWeb\__construct(), and ezpKernelRest\__construct().

## ◆ 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 429 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 449 of file ezsiteaccess.php.

References $ret.

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 479 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 692 of file ezsiteaccess.php.

References $ini, $language, and eZDebug\writeWarning().

## ◆ siteAccessList()

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

Definition at line 38 of file ezsiteaccess.php.

References $ini, 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 561 of file ezsiteaccess.php.

References $name.

Referenced by match().

## Member Data Documentation

## ◆ SUBTYPE_POST

const eZSiteAccess::SUBTYPE_POST = 2

Definition at line 36 of file ezsiteaccess.php.

## ◆ SUBTYPE_PRE

const eZSiteAccess::SUBTYPE_PRE = 1

Definition at line 35 of file ezsiteaccess.php.

## ◆ TYPE_CUSTOM

const eZSiteAccess::TYPE_CUSTOM = 10

Definition at line 33 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 24 of file ezsiteaccess.php.

Referenced by match().

## ◆ TYPE_HTTP_HOST

const eZSiteAccess::TYPE_HTTP_HOST = 4

Definition at line 27 of file ezsiteaccess.php.

Referenced by match().

## ◆ TYPE_HTTP_HOST_URI

const eZSiteAccess::TYPE_HTTP_HOST_URI = 9

Definition at line 32 of file ezsiteaccess.php.

Referenced by match().

## ◆ TYPE_INDEX_FILE

const eZSiteAccess::TYPE_INDEX_FILE = 5

Definition at line 28 of file ezsiteaccess.php.

Referenced by match().

## ◆ TYPE_PORT

const eZSiteAccess::TYPE_PORT = 3

Definition at line 26 of file ezsiteaccess.php.

Referenced by match().

## ◆ TYPE_SERVER_VAR

const eZSiteAccess::TYPE_SERVER_VAR = 7

Definition at line 30 of file ezsiteaccess.php.

Referenced by match().

## ◆ TYPE_STATIC

const eZSiteAccess::TYPE_STATIC = 6

Definition at line 29 of file ezsiteaccess.php.

Referenced by ezpKernelRest\__construct(), getIni(), match(), and eZWebDAVContentBackend\setCurrentSite().

## ◆ TYPE_URI

const eZSiteAccess::TYPE_URI = 2

Definition at line 25 of file ezsiteaccess.php.

Referenced by change(), ezpLanguageSwitcher\destinationUrl(), match(), ezpLanguageSwitcher\process(), ezpbKernelAdmin\requestInit(), ezpbKernelWeb\requestInit(), and ezpKernelWeb\requestInit().

## ◆ TYPE_URL

const eZSiteAccess::TYPE_URL = 8

Definition at line 31 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+.