kernel/classes/ezsiteaccess.php

Show: inherited
Table of Contents

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

Package: kernel

Provides functions for siteaccess handling

Constants

Constant  TYPE_DEFAULT = 1

Integer constants that identify the siteaccess matching used

Since
4.4 Was earlier in access.php as normal constants  
Constant  TYPE_URI = 2
Constant  TYPE_PORT = 3
Constant  TYPE_HTTP_HOST = 4
Constant  TYPE_INDEX_FILE = 5
Constant  TYPE_STATIC = 6
Constant  TYPE_SERVER_VAR = 7
Constant  TYPE_URL = 8
Constant  TYPE_HTTP_HOST_URI = 9
Constant  SUBTYPE_PRE = 1
Constant  SUBTYPE_POST = 2

Methods

methodpublicchange( array $access, \eZINI | null $siteINI = null ) : array
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 {@link eZSiteAccess::load()} if you want that

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

Returns
Type Description
array The $access parameter
Details
Since
4.4  
methodpubliccurrent( ) : void
static

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

Details
Since
4.4 return array|null  
methodpublicdebugEnabled( ) : bool
static

Checks if site access debug is enabled

Returns
Type Description
bool
Details
Deprecated
Should use debug.ini conditions instead of extra settings  
Since
4.4  
methodpubliceZSiteAccess( ) : void

methodpublicextraDebugEnabled( ) : bool
static

Checks if extra site access debug is enabled

Returns
Type Description
bool
Details
Deprecated
Should use debug.ini conditions instead of extra settings  
Since
4.4  
methodpublicfindPathToSiteAccess( string $siteAccess ) : string | false
static

Returns path to site access

Parameters
Name Type Description
$siteAccess string
Returns
Type Description
string | false Return path to siteacces or false if invalid
methodpublicgetIni( string $siteAccess, string $settingFile = 'site.ini' ) : \eZINI
static

Loads ini environment for a specific siteaccess

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

Parameters
Name Type Description
$siteAccess string
$settingFile string
Returns
Type Description
\eZINI
Details
Since
4.4  
methodpublicload( array $access, \eZINI | null $siteINI = null ) : array
static

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()}
Parameters
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.

Returns
Type Description
array The $access parameter
Details
Since
4.4  
methodpublicmatch( \eZURI $uri, string $host, \string(numeric) $port = 80, string $file = '/index.php' ) : array
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

Parameters
Name Type Description
$uri \eZURI
$host string
$port \string(numeric)
$file string

Example '/index.php'

Returns
Type Description
array
Details
Since
4.4  
methodpublicmatchRegexp( string $text, string $reg, int $num ) : string | null
static

Match a regex expression

Parameters
Name Type Description
$text string
$reg string
$num int
Returns
Type Description
string | null
Details
Since
4.4  
methodpublicmatchText( string $text, string $match_pre, string $match_post ) : string | null
static

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

Parameters
Name Type Description
$text string
$match_pre string
$match_post string
Returns
Type Description
string | null
Details
Since
4.4  
methodpublicreInitialise( ) : bool
static

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

Returns
Type Description
bool True if re-initialisation was successful
methodpublicsaNameByLanguage( string $language ) : string | null
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.

Parameters
Name Type Description
$language string

eg: eng-GB

Returns
Type Description
string | null
Details
Since
4.5  
methodpublicsiteAccessList( ) : void
static

Documentation was generated by DocBlox 0.18.1.