eZPublish  3.8
eZSys Class Reference

Easy access to various system settings. More...

Public Member Functions

attribute ($attr)
 
 attributes ()
 
environmentVariable ($variableName, $quiet=false)
 
 ezcrc32 ($string)
 
 eZSys ()
 
 hasAttribute ($attr)
 
 initIni (&$ini)
 
 isPHPVersionSufficient ($requiredVersion)
 
 path ($quiet=false)
 
 phpVersion ()
 
 removeMagicQuotes ()
 
 requestURI ()
 
serverVariable ($variableName, $quiet=false)
 
 setEnvironmentVariable ($variableName, $variableValue)
 
 setServerVariable ($variableName, $variableValue)
 

Static Public Member Functions

 addAccessPath ($path)
 
 backupFilename ()
 
 cacheDirectory ()
 
 clearAccessPath ()
 
 createShellArgument ($argumentText, $replaceList)
 
 envSeparator ()
 
 escapeShellArgument ($argument)
 
 fileSeparator ()
 
 filesystemType ()
 
hostname ()
 
indexDir ($withAccessList=true)
 
indexFile ($withAccessList=true)
 
 indexFileName ()
 
 init ($def_index="index.php", $force_VirtualHost=false)
 
instance ()
 
 isDebugEnabled ()
 
 isShellExecution ()
 
 isSSLNow ()
 
 lineSeparator ()
 
magickQuotes ()
 
 mergeArgumentElements ($argumentElements)
 
 osName ()
 
 osType ()
 
 phpVersionText ()
 
 rootDir ()
 
 serverPort ()
 
 serverProtocol ()
 
 serverURL ()
 
 setIsDebugEnabled ($debug)
 
siteDir ()
 
 splitArgumentIntoElements ($argumentText)
 
 storageDirectory ()
 
 varDirectory ()
 
wwwDir ()
 

Public Attributes

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

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(). In addition userIndexFile(), adminIndexFile() and xmlrpcIndexFile() can be used to fetch the index file of the user page, admin page and xmlrpc interface.

Example:

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

Member Function Documentation

eZSys::addAccessPath (   $path)
static

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

See Also
indexFile

Referenced by changeAccess(), and eZContentCacheManager\generateObjectViewCache().

& eZSys::attribute (   $attr)

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

eZSys::attributes ( )

Referenced by hasAttribute().

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

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

eZSys::clearAccessPath ( )
static

Empties the access path.

Referenced by eZContentCacheManager\generateObjectViewCache().

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

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

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

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

Referenced by eZSetupCheckExecutable().

eZSys::escapeShellArgument (   $argument)
static

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

Referenced by eZImageShellHandler\convert().

eZSys::eZSys ( )

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

Referenced by instance().

eZSys::fileSeparator ( )
static

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

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

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

Referenced by eZStepEmailSettings\display(), eZSetupCheckExecutable(), and eZStepEmailSettings\init().

eZSys::hasAttribute (   $attr)

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

& eZSys::hostname ( )
static
& eZSys::indexFile (   $withAccessList = true)
static

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

See Also
indexFileName

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

eZSys::indexFileName ( )
static

The filepath for the index file.

Referenced by eZStepSecurity\init().

eZSys::init (   $def_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.

eZSys::initIni ( $ini)

Initializes some variables which are read from site.ini

Warning
Do not call this before init()
eZSys::isDebugEnabled ( )
static
Returns
true if debugging of internals is enabled, this will display which server variables are read. Set the option with setIsDebugEnabled().

Referenced by init().

eZSys::isPHPVersionSufficient (   $requiredVersion)
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 ) );

Referenced by eZImageGDHandler\isImageTrueColor().

eZSys::isShellExecution ( )
static

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

eZSys::isSSLNow ( )
static

Determines if SSL is enabled and protocol HTTPS is used.

Returns
true if current access mode is HTTPS.

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

eZSys::lineSeparator ( )
static

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

Referenced by eZINI\save().

& eZSys::magickQuotes ( )
static

Returns true if magick quotes is enabled.

eZSys::mergeArgumentElements (   $argumentElements)
static

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

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)
eZSys::path (   $quiet = false)
Returns
the path string for the server.

Referenced by eZSetupCheckExecutable().

eZSys::phpVersion ( )

Referenced by isPHPVersionSufficient().

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

Referenced by phpVersion().

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

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

eZSys::rootDir ( )
static

The absolute path to the root directory.

Referenced by eZSetupTestDirectoryPermissions().

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

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

eZSys::serverProtocol ( )
static

Referenced by extension_path().

eZSys::serverURL ( )
static

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

& eZSys::serverVariable (   $variableName,
  $quiet = false 
)
eZSys::setEnvironmentVariable (   $variableName,
  $variableValue 
)

Sets the environment variable named $variableName to $variableValue.

Note
Variables are only set for the current page view.
eZSys::setIsDebugEnabled (   $debug)
static

Sets whether internal debugging is enabled or not.

eZSys::setServerVariable (   $variableName,
  $variableValue 
)

Sets the server variable named $variableName to $variableValue.

Note
Variables are only set for the current page view.
& eZSys::siteDir ( )
static

The path to where all the code resides.

Referenced by attribute().

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

eZSys::varDirectory ( )
static
Returns
the directory used for storing various kinds of files like cache, temporary files and logs.

Referenced by eZWebDAVServer\appendLogEntry(), cacheDirectory(), eZDebug\printReport(), and storageDirectory().

Member Data Documentation

eZSys::$AccessPath

The access path of the current site view.

eZSys::$EnvSeparator

The list separator used for env variables.

eZSys::$FileSeparator

The directory separator used for files.

eZSys::$FileSystemType

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

eZSys::$IndexFile

The filepath for the index.

eZSys::$LineSeparator

The line separator used in files.

eZSys::$OSType
eZSys::$RequestURI

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

eZSys::$RootDir

The absolute path to the root directory.

eZSys::$ShellEscapeCharacter

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

eZSys::$SiteDir

The path to where all the code resides.

eZSys::$WWWDir

The relative directory path of the vhless setup.


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