eZ Publish  [4.2]
eZSys Class Reference

Easy access to various system settings. More...

List of all members.

Public Member Functions

 attribute ($attr)
 attributes ()
 eZSys ()
 hasAttribute ($attr)
 removeMagicQuotes ()

Static Public Member Functions

static addAccessPath ($path)
static backupFilename ()
static cacheDirectory ()
static clearAccessPath ()
static createShellArgument ($argumentText, $replaceList)
static & environmentVariable ($variableName, $quiet=false)
static envSeparator ()
static escapeShellArgument ($argument)
static ezcrc32 ($string)
static fileSeparator ()
static filesystemType ()
static globBrace ($pattern, $flags=0)
static hostname ()
static indexDir ($withAccessList=true)
static indexFile ($withAccessList=true)
static indexFileName ()
static init ($index="index.php", $force_VirtualHost=false)
static instance ()
 Returns a shared instance of the eZSys class.
static isDebugEnabled ()
static isPHPVersionSufficient ($requiredVersion)
static isShellExecution ()
static isSSLNow ()
static lineSeparator ()
static magickQuotes ()
static mergeArgumentElements ($argumentElements)
static osName ()
static osType ()
static path ($quiet=false)
static phpVersion ()
static phpVersionText ()
static protocolSchema ()
static requestURI ()
static rootDir ()
static serverPort ()
static serverProtocol ()
static serverURL ()
static serverVariable ($variableName, $quiet=false)
static setEnvironmentVariable ($variableName, $variableValue)
static setIsDebugEnabled ($debug)
static setServerVariable ($variableName, $variableValue)
static siteDir ()
static splitArgumentIntoElements ($argumentText)
static storageDirectory ()
static varDirectory ()
static wwwDir ()

Public Attributes

 $AccessPath
 The access path of the current site view.
 $EnvSeparator
 The list separator used for env variables.
 $FileSeparator
 The directory separator used for files.
 $FileSystemType
 The type of filesystem, is either win32 or unix. This often used to determine os specific paths.
 $IndexFile
 The filepath for the index.
 $LineSeparator
 The line separator used in files.
 $OSType
 $RequestURI
 The uri which is used for parsing module/view information from, may differ from $_SERVER['REQUEST_URI'].
 $RootDir
 The absolute path to the root directory.
 $ShellEscapeCharacter
 The character to be used in shell escaping, this character is OS specific.
 $SiteDir
 The path to where all the code resides.
 $WWWDir
 The relative directory path of the vhless setup.
const DEBUG_INTERNALS = false

Static Protected Member Functions

static simulateGlobBrace ($filenames)

Detailed Description

Easy access to various system settings.

The system is checked to see whether a virtualhost-less setup is used and sets the appropriate variables which can be fetched with siteDir(), wwwDir() and indexFile(). It also detects file and enviroment separators, fetch them with fileSeparator() and envSeparator().

Example:

// Run the init in the index file
eZSys::init( eZINI::instance() );
print( eZSys::indexFile() );
print( eZSys::wwwDir() );

Definition at line 53 of file ezsys.php.


Member Function Documentation

static eZSys::addAccessPath ( path) [static]

Sets the access path which is appended to the index file.

See also:
indexFile

Definition at line 808 of file ezsys.php.

Referenced by eZContentCacheManager\generateObjectViewCache().

eZSys::attribute ( attr)

Returns the attribute value for $attr or null if the attribute does not exist.

Definition at line 776 of file ezsys.php.

eZSys::attributes ( )

Definition at line 754 of file ezsys.php.

Referenced by hasAttribute().

static eZSys::backupFilename ( ) [static]
Returns:
the backup filename for this platform, returns .bak for win32 and ~ for unix and mac.

Definition at line 405 of file ezsys.php.

Referenced by eZCodeTemplate\apply(), and eZINI\save().

static eZSys::clearAccessPath ( ) [static]

Empties the access path.

Definition at line 820 of file ezsys.php.

Referenced by eZContentCacheManager\generateObjectViewCache().

static eZSys::createShellArgument ( argumentText,
replaceList 
) [static]

Replaces % elements in the argument text $argumentText using the replace list $replaceList. It will also properly escape the argument.

See also:
splitArgumentIntoElements, mergeArgumentElements

Definition at line 271 of file ezsys.php.

Referenced by eZImageShellHandler\convert(), and eZImageHandler\convertFilterToText().

static& eZSys::environmentVariable ( variableName,
quiet = false 
) [static]
Returns:
the variable named $variableName in the global $_ENV variable. If the variable is not present an error is shown and null is returned.

Definition at line 729 of file ezsys.php.

static eZSys::envSeparator ( ) [static]

Returns the string which is used for enviroment separators on the current OS (server).

Definition at line 423 of file ezsys.php.

static eZSys::escapeShellArgument ( argument) [static]

Escape a string to be used as a shell argument and return it.

Definition at line 249 of file ezsys.php.

Referenced by eZImageShellHandler\convert().

eZSys::eZSys ( )

Initializes the object with settings taken from the current script run.

Definition at line 60 of file ezsys.php.

Referenced by instance().

static eZSys::fileSeparator ( ) [static]

Returns the string which is used for file separators on the current OS (server).

Definition at line 172 of file ezsys.php.

Referenced by eZImageShellHandler\convert(), eZDir\isWriteable(), and eZDir\separator().

static eZSys::filesystemType ( ) [static]
Returns:
the filesystem type, either "win32" or "unix"

Definition at line 163 of file ezsys.php.

static eZSys::globBrace ( pattern,
flags = 0 
) [static]

Wraps around the built-in glob() function to provide same functionality for systems (e.g Solaris) that does not support GLOB_BRACE.

Definition at line 1090 of file ezsys.php.

Referenced by eZFS2FileHandler\fileDeleteByDirList(), eZFSFileHandler\fileDeleteByDirList(), and eZFSFileHandler\fileDeleteByWildcard().

eZSys::hasAttribute ( attr)

Return true if the attribute $attr is set. Available attributes are wwwdir, sitedir or indexfile

Definition at line 768 of file ezsys.php.

static eZSys::hostname ( ) [static]
static eZSys::indexDir ( withAccessList = true) [static]
static eZSys::indexFile ( withAccessList = true) [static]

The filepath for the index file with the access path appended.

See also:
indexFileName

Definition at line 528 of file ezsys.php.

Referenced by attribute(), eZTemplateCompiler\compilationFilename(), eZNodeviewfunctions\generateViewCacheFile(), eZUser\instance(), and ezpLanguageSwitcher\process().

static eZSys::indexFileName ( ) [static]

The filepath for the index file.

Definition at line 575 of file ezsys.php.

Referenced by eZSiteInstaller\createSiteaccessUrls().

static eZSys::init ( index = "index.php",
force_VirtualHost = false 
) [static]

Initializes some variables according to some global PHP values. This function should be called once in the index file with the parameters stated in the parameter list.

Definition at line 853 of file ezsys.php.

static eZSys::isDebugEnabled ( ) [static]
Returns:
true if debugging of internals is enabled, this will display which server variables are read. Set the option with setIsDebugEnabled().

Definition at line 831 of file ezsys.php.

Referenced by init().

static eZSys::isPHPVersionSufficient ( requiredVersion) [static]
Returns:
true if the PHP version is equal or higher than $requiredVersion.
Parameters:
$requiredVersionmust be an array with version number.
     eZSys::isPHPVersionSufficient( array( 4, 1, 0 ) );

Definition at line 206 of file ezsys.php.

static eZSys::isShellExecution ( ) [static]

Determins if the script got executed over the web or the shell/commandoline.

Definition at line 226 of file ezsys.php.

Referenced by eZDebug\isAllowedByCurrentIP(), and eZDBInterface\reportError().

static eZSys::isSSLNow ( ) [static]

Determines if SSL is enabled and protocol HTTPS is used.

Returns:
true if current access mode is HTTPS.

Definition at line 601 of file ezsys.php.

Referenced by serverProtocol(), serverURL(), and eZSSLZone\switchIfNeeded().

static eZSys::lineSeparator ( ) [static]

Returns the string which is used for line separators on the current OS (server).

Definition at line 414 of file ezsys.php.

Referenced by eZINI\save().

static eZSys::magickQuotes ( ) [static]

Returns true if magick quotes is enabled.

Definition at line 684 of file ezsys.php.

static eZSys::mergeArgumentElements ( argumentElements) [static]

Merges an argument list created by splitArgumentIntoElements() back into a text string. The argument text will be properly quoted.

Definition at line 383 of file ezsys.php.

static eZSys::osName ( ) [static]
Returns:
the name of the specific os or false if it could not be determined. Currently detects:
  • windows (win32)
  • mac (mac)
  • linux (unix)
  • freebsd (unix)

Definition at line 154 of file ezsys.php.

static eZSys::path ( quiet = false) [static]
Returns:
the path string for the server.

Definition at line 720 of file ezsys.php.

Referenced by cacheDirectory(), storageDirectory(), and varDirectory().

static eZSys::phpVersion ( ) [static]
Returns:
the PHP version as an array with the version elements.

Definition at line 191 of file ezsys.php.

Referenced by isPHPVersionSufficient().

static eZSys::phpVersionText ( ) [static]
Returns:
the PHP version as text.
Note:
Calls phpversion().

Definition at line 182 of file ezsys.php.

Referenced by phpVersion().

static eZSys::protocolSchema ( ) [static]

Returns the schema of the request.

Definition at line 1073 of file ezsys.php.

eZSys::removeMagicQuotes ( )

Definition at line 121 of file ezsys.php.

Referenced by eZSys().

static eZSys::requestURI ( ) [static]
Returns:
the URI used for parsing modules, views and parameters, may differ from $_SERVER['REQUEST_URI'].

Definition at line 1035 of file ezsys.php.

Referenced by init(), eZURI\instance(), eZUser\instance(), and eZSSLZone\switchIfNeeded().

static eZSys::rootDir ( ) [static]

The absolute path to the root directory.

Definition at line 475 of file ezsys.php.

Referenced by checkPaths(), and eZDir\recursiveDelete().

static eZSys::serverPort ( ) [static]
Returns:
the port of the server.

Definition at line 662 of file ezsys.php.

Referenced by eZHTTPTool\createRedirectUrl(), and isSSLNow().

static eZSys::serverProtocol ( ) [static]

Definition at line 622 of file ezsys.php.

Referenced by extension_path().

static eZSys::serverURL ( ) [static]

Returns the server URL. (protocol with hostname and port)

Definition at line 634 of file ezsys.php.

static eZSys::serverVariable ( variableName,
quiet = false 
) [static]
Returns:
the variable named $variableName in the global $_SERVER variable. If the variable is not present an error is shown and null is returned.

Definition at line 693 of file ezsys.php.

Referenced by eZHTTPTool\createRedirectUrl(), hostname(), eZWeb\init(), init(), eZDebug\isAllowedByCurrentIP(), isShellExecution(), eZUser\isUserIPInList(), path(), protocolSchema(), eZDBInterface\reportError(), serverPort(), eZSiteAccess\siteAccessList(), eZSSLZone\switchIfNeeded(), eZDebug\write(), eZAudit\writeAudit(), and eZDebug\writeFile().

static eZSys::setEnvironmentVariable ( variableName,
variableValue 
) [static]

Sets the environment variable named $variableName to $variableValue.

Note:
Variables are only set for the current page view.

Definition at line 748 of file ezsys.php.

static eZSys::setIsDebugEnabled ( debug) [static]

Sets whether internal debugging is enabled or not.

Definition at line 842 of file ezsys.php.

static eZSys::setServerVariable ( variableName,
variableValue 
) [static]

Sets the server variable named $variableName to $variableValue.

Note:
Variables are only set for the current page view.

Definition at line 711 of file ezsys.php.

static eZSys::simulateGlobBrace ( filenames) [static, protected]

Expands a list of filenames like GLOB_BRACE does.

GLOB_BRACE is non POSIX and only available in GNU glibc. This is needed to support operating systems like Solars.

Definition at line 1122 of file ezsys.php.

Referenced by globBrace().

static eZSys::siteDir ( ) [static]

The path to where all the code resides.

Definition at line 499 of file ezsys.php.

Referenced by attribute().

static eZSys::splitArgumentIntoElements ( argumentText) [static]

Splits the argument text into argument array elements. It will split text on spaces and set them as strings in the array, spaces will be counted and inserted as integers with the space count. Text placed in quotes will also be parsed, this allows for spaces in the text.

     $list = splitArgumentIntoElements( "-geometry 100x100" );

     var_dump( $list ); // will give: array( "-geometry", 1, "100x100" );

You can then easily modify the elements separately and create the argument text with mergeArgumentElements().

Definition at line 303 of file ezsys.php.

static eZSys::varDirectory ( ) [static]

Member Data Documentation

eZSys::$AccessPath

The access path of the current site view.

Definition at line 1168 of file ezsys.php.

eZSys::$EnvSeparator

The list separator used for env variables.

Definition at line 1162 of file ezsys.php.

eZSys::$FileSeparator

The directory separator used for files.

Definition at line 1160 of file ezsys.php.

eZSys::$FileSystemType

The type of filesystem, is either win32 or unix. This often used to determine os specific paths.

Definition at line 1176 of file ezsys.php.

eZSys::$IndexFile

The filepath for the index.

Definition at line 1172 of file ezsys.php.

eZSys::$LineSeparator

The line separator used in files.

Definition at line 1158 of file ezsys.php.

eZSys::$OSType

Definition at line 1179 of file ezsys.php.

eZSys::$RequestURI

The uri which is used for parsing module/view information from, may differ from $_SERVER['REQUEST_URI'].

Definition at line 1174 of file ezsys.php.

eZSys::$RootDir

The absolute path to the root directory.

Definition at line 1164 of file ezsys.php.

eZSys::$ShellEscapeCharacter

The character to be used in shell escaping, this character is OS specific.

Definition at line 1178 of file ezsys.php.

eZSys::$SiteDir

The path to where all the code resides.

Definition at line 1166 of file ezsys.php.

eZSys::$WWWDir

The relative directory path of the vhless setup.

Definition at line 1170 of file ezsys.php.

const eZSys::DEBUG_INTERNALS = false

Definition at line 55 of file ezsys.php.

Referenced by isDebugEnabled().


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