eZPublish  4.3
eZSys Class Reference

Easy access to various system settings. More...

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 hasEnvironmentVariable ($variableName)
 
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. More...
 
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. 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...
 
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
print( eZSys::indexFile() );
print( eZSys::wwwDir() );

Member Function Documentation

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

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

static eZSys::clearAccessPath ( )
static

Empties the access path.

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

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.

Referenced by eZSetupTestFileUpload().

static eZSys::envSeparator ( )
static

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

Referenced by eZSetupCheckExecutable().

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

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

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

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

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.

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

static eZSys::hasEnvironmentVariable (   $variableName)
static
Returns
the true if variable named $variableName exists. If the variable is not present false is returned.

Referenced by eZSetupTestFileUpload().

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

The filepath for the index file.

Referenced by eZSiteInstaller\createSiteaccessUrls(), and eZStepSecurity\init().

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.

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

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 ) );
static eZSys::isShellExecution ( )
static

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

Referenced by eZDebug\isAllowedByCurrentIP(), eZContentOperationCollection\publishNode(), 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.

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

Referenced by eZINI\save().

static eZSys::magickQuotes ( )
static

Returns true if magick quotes is enabled.

static eZSys::mergeArgumentElements (   $argumentElements)
static

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

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

Referenced by eZSetupCheckExecutable().

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

Referenced by isPHPVersionSufficient().

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

Referenced by phpVersion().

static eZSys::protocolSchema ( )
static

Returns the schema of the request.

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

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

static eZSys::rootDir ( )
static

The absolute path to the root directory.

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

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

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

static eZSys::serverProtocol ( )
static

Referenced by extension_path().

static eZSys::serverURL ( )
static

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

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

Sets the environment variable named $variableName to $variableValue.

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

Sets whether internal debugging is enabled or not.

static eZSys::setServerVariable (   $variableName,
  $variableValue 
)
static

Sets the server variable named $variableName to $variableValue.

Note
Variables are only set for the current page view.
static eZSys::simulateGlobBrace (   $filenames)
staticprotected

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.

static eZSys::siteDir ( )
static

The path to where all the code resides.

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

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.

const eZSys::DEBUG_INTERNALS = false

Referenced by isDebugEnabled().


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