eZSys Class Reference
[Utility classes]

Easy access to various system settings. More...

List of all members.

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 ()
 globBrace ($pattern, $flags=0)
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.
 $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.

Static Protected Member Functions

 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 57 of file ezsys.php.


Member Function Documentation

eZSys::addAccessPath ( path  )  [static]

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

See also:
indexFile

Definition at line 864 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 827 of file ezsys.php.

eZSys::attributes (  ) 

Definition at line 805 of file ezsys.php.

Referenced by hasAttribute().

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

Definition at line 431 of file ezsys.php.

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

eZSys::cacheDirectory (  )  [static]
eZSys::clearAccessPath (  )  [static]

Empties the access path.

Definition at line 879 of file ezsys.php.

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

Definition at line 287 of file ezsys.php.

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.

Definition at line 782 of file ezsys.php.

eZSys::envSeparator (  )  [static]

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

Definition at line 457 of file ezsys.php.

eZSys::escapeShellArgument ( argument  )  [static]

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

Definition at line 268 of file ezsys.php.

Referenced by eZImageShellHandler::convert().

eZSys::ezcrc32 ( string  ) 
eZSys::eZSys (  ) 

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

Definition at line 62 of file ezsys.php.

Referenced by instance().

eZSys::fileSeparator (  )  [static]

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

Definition at line 184 of file ezsys.php.

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

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

Definition at line 171 of file ezsys.php.

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 1153 of file ezsys.php.

Referenced by 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 819 of file ezsys.php.

& eZSys::hostname (  )  [static]

Returns the current hostname.

Definition at line 651 of file ezsys.php.

Referenced by eZHTTPTool::createRedirectUrl(), extension_path(), eZRSSExport::fetchImageURL(), serverPort(), and serverURL().

& eZSys::indexDir ( withAccessList = true  )  [static]

The filepath for the index file.

Definition at line 572 of file ezsys.php.

Referenced by attribute(), eZWebDAVContentServer::currentSiteFromPath(), eZWebDAVContentServer::processURL(), and eZSSLZone::switchIfNeeded().

& eZSys::indexFile ( withAccessList = true  )  [static]

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

See also:
indexFileName

Definition at line 588 of file ezsys.php.

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

eZSys::indexFileName (  )  [static]

The filepath for the index file.

Definition at line 638 of file ezsys.php.

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.

Definition at line 916 of file ezsys.php.

eZSys::initIni ( &$  ini  ) 

Initializes some variables which are read from site.ini

Warning:
Do not call this before init()

Definition at line 1112 of file ezsys.php.

& eZSys::instance (  )  [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 894 of file ezsys.php.

Referenced by init().

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

Definition at line 225 of file ezsys.php.

Referenced by eZImageGDHandler::isImageTrueColor().

eZSys::isShellExecution (  )  [static]

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

Definition at line 245 of file ezsys.php.

Referenced by eZDBInterface::reportError().

eZSys::isSSLNow (  )  [static]

Determines if SSL is enabled and protocol HTTPS is used.

Returns:
true if current access mode is HTTPS.

Definition at line 662 of file ezsys.php.

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

eZSys::lineSeparator (  )  [static]

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

Definition at line 444 of file ezsys.php.

Referenced by eZINI::save().

& eZSys::magickQuotes (  )  [static]

Returns true if magick quotes is enabled.

Definition at line 738 of file ezsys.php.

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 406 of file ezsys.php.

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 158 of file ezsys.php.

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

Definition at line 773 of file ezsys.php.

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

eZSys::phpVersion (  ) 

Definition at line 210 of file ezsys.php.

Referenced by isPHPVersionSufficient().

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

Definition at line 198 of file ezsys.php.

Referenced by phpVersion().

eZSys::removeMagicQuotes (  ) 

Definition at line 121 of file ezsys.php.

Referenced by eZSys().

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

Definition at line 1099 of file ezsys.php.

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

eZSys::rootDir (  )  [static]

The absolute path to the root directory.

Definition at line 519 of file ezsys.php.

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

Definition at line 716 of file ezsys.php.

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

eZSys::serverProtocol (  )  [static]

Definition at line 676 of file ezsys.php.

Referenced by extension_path().

eZSys::serverURL (  )  [static]

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

Definition at line 688 of file ezsys.php.

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

Definition at line 799 of file ezsys.php.

eZSys::setIsDebugEnabled ( debug  )  [static]

Sets whether internal debugging is enabled or not.

Definition at line 905 of file ezsys.php.

eZSys::setServerVariable ( variableName,
variableValue 
)

Sets the server variable named $variableName to $variableValue.

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

Definition at line 764 of file ezsys.php.

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 1181 of file ezsys.php.

Referenced by globBrace().

& eZSys::siteDir (  )  [static]

The path to where all the code resides.

Definition at line 546 of file ezsys.php.

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

Definition at line 322 of file ezsys.php.

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

Definition at line 470 of file ezsys.php.

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

& eZSys::wwwDir (  )  [static]

Member Data Documentation

eZSys::$AccessPath

The access path of the current site view.

Definition at line 1227 of file ezsys.php.

eZSys::$EnvSeparator

The list separator used for env variables.

Definition at line 1221 of file ezsys.php.

eZSys::$FileSeparator

The directory separator used for files.

Definition at line 1219 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 1235 of file ezsys.php.

eZSys::$IndexFile

The filepath for the index.

Definition at line 1231 of file ezsys.php.

eZSys::$LineSeparator

The line separator used in files.

Definition at line 1217 of file ezsys.php.

eZSys::$OSType

Definition at line 1238 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 1233 of file ezsys.php.

eZSys::$RootDir

The absolute path to the root directory.

Definition at line 1223 of file ezsys.php.

eZSys::$ShellEscapeCharacter

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

Definition at line 1237 of file ezsys.php.

eZSys::$SiteDir

The path to where all the code resides.

Definition at line 1225 of file ezsys.php.

eZSys::$WWWDir

The relative directory path of the vhless setup.

Definition at line 1229 of file ezsys.php.


The documentation for this class was generated from the following file:
Generated on Mon Jul 12 07:10:31 2010 for eZ publish by  doxygen 1.6.3