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 () | |
| 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) | |
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.
| eZSys::addAccessPath | ( | $ | path | ) | [static] |
Sets the access path which is appended to the index file.
Definition at line 864 of file ezsys.php.
Referenced by eZContentCacheManager::generateObjectViewCache().
| & eZSys::attribute | ( | $ | attr | ) |
| eZSys::attributes | ( | ) |
Definition at line 805 of file ezsys.php.
Referenced by hasAttribute().
| eZSys::backupFilename | ( | ) | [static] |
Definition at line 431 of file ezsys.php.
Referenced by eZCodeTemplate::apply(), and eZINI::save().
| eZSys::cacheDirectory | ( | ) | [static] |
Definition at line 498 of file ezsys.php.
Referenced by eZContentClassAttribute::cachedInfo(), eZTemplateTreeCache::cacheDirectory(), eZSSLZone::cacheFileName(), eZURLAlias::cacheInfo(), eZContentCache::cachePathInfo(), eZPDFTable::callImage(), eZContentObjectTreeNode::classAttributeIDByIdentifier(), eZContentObjectTreeNode::classIDByIdentifier(), eZContentCache::cleanup(), eZCache::clearClassID(), eZCache::clearItem(), eZCache::clearSortKey(), eZCache::clearTemplateBlockCache(), eZTemplateCompiler::compilationDirectory(), eZTemplateDesignResource::createOverrideCache(), eZTemplateCacheFunction::expiryTemplateBlockCacheDir(), eZImageManager::eZImageManager(), eZMutex::eZMutex(), eZNodeviewfunctions::generateViewCacheFile(), eZSSLZone::getSSLZones(), eZScript::initialize(), eZExpiryHandler::restore(), eZTranslationCache::rootCacheDirectory(), eZExpiryHandler::store(), eZPackageType::storeObjectAttribute(), and eZTemplateCacheFunction::templateBlockCacheDir().
| 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.
Definition at line 287 of file ezsys.php.
Referenced by eZImageShellHandler::convert(), and eZImageHandler::convertFilterToText().
| & eZSys::environmentVariable | ( | $ | variableName, | |
| $ | quiet = false | |||
| ) |
| eZSys::envSeparator | ( | ) | [static] |
| 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 | ) |
A wrapper for php's crc32 function.
Definition at line 1134 of file ezsys.php.
Referenced by eZImageManager::createImageAliasKey(), eZTemplateDesignResource::createOverrideCache(), eZTemplateDesignResource::handleResource(), eZTemplateDigestOperator::modify(), eZTemplateCacheFunction::process(), eZSiteAccess::siteAccessList(), eZTemplateCacheFunction::templateNodeTransformation(), eZCharTransform::transform(), eZCharTransform::transformByGroup(), and eZWebDAVContentServer::userHasSiteAccess().
| 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] |
| 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 | ) |
| & 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.
Definition at line 588 of file ezsys.php.
Referenced by attribute(), eZTemplateCompiler::compilationFilename(), eZNodeviewfunctions::generateViewCacheFile(), and eZUser::instance().
| eZSys::indexFileName | ( | ) | [static] |
| eZSys::init | ( | $ | def_index = "index.php", |
|
| $ | force_VirtualHost = false | |||
| ) | [static] |
| eZSys::initIni | ( | &$ | ini | ) |
| & eZSys::instance | ( | ) | [static] |
Returns the only legal instance of the eZSys class.
Definition at line 1120 of file ezsys.php.
Referenced by addAccessPath(), backupFilename(), cacheDirectory(), clearAccessPath(), createShellArgument(), eZMediaType::deleteStoredObjectAttribute(), eZBinaryFileType::deleteStoredObjectAttribute(), envSeparator(), escapeShellArgument(), ezcrc32(), eZMail::eZMail(), eZURLOperator::eZURLOperator(), eZPDFExport::filepath(), fileSeparator(), filesystemType(), eZImageVariation::fullPath(), indexDir(), indexFile(), indexFileName(), init(), isSSLNow(), lineSeparator(), mergeArgumentElements(), osName(), osType(), eZPDFExport::remove(), requestURI(), eZImageVariation::requestVariation(), rootDir(), eZSysInfo::scan(), eZSendmailTransport::sendMail(), serverURL(), siteDir(), splitArgumentIntoElements(), eZHTTPFile::storageDir(), storageDirectory(), varDirectory(), and wwwDir().
| eZSys::isDebugEnabled | ( | ) | [static] |
Definition at line 894 of file ezsys.php.
Referenced by init().
| eZSys::isPHPVersionSufficient | ( | $ | requiredVersion | ) |
true if the PHP version is equal or higher than $requiredVersion. | $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.
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] |
| 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] |
| eZSys::osType | ( | ) | [static] |
"win32", "unix" or "mac" Definition at line 140 of file ezsys.php.
Referenced by eZTARArchiveHandler::_extractList(), eZTARArchiveHandler::_translateWinPath(), eZImageShellHandler::convert(), eZGZIPZLIBCompressionHandler::isAvailable(), eZFile::isWriteable(), eZDir::isWriteable(), and eZFileHandler::linkCopy().
| eZSys::path | ( | $ | quiet = false |
) |
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] |
Definition at line 198 of file ezsys.php.
Referenced by phpVersion().
| eZSys::requestURI | ( | ) |
Definition at line 1099 of file ezsys.php.
Referenced by init(), eZUser::instance(), and eZSSLZone::switchIfNeeded().
| eZSys::rootDir | ( | ) | [static] |
| eZSys::serverPort | ( | ) | [static] |
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] |
| & eZSys::serverVariable | ( | $ | variableName, | |
| $ | quiet = false | |||
| ) |
$_SERVER variable. If the variable is not present an error is shown and null is returned. Definition at line 748 of file ezsys.php.
Referenced by eZHTTPTool::createRedirectUrl(), eZXMLInputType::editorName(), hostname(), eZWeb::init(), init(), eZXMLInputType::instance(), isShellExecution(), eZUser::isUserIPInList(), path(), eZDBInterface::reportError(), serverPort(), eZSiteAccess::siteAccessList(), eZSSLZone::switchIfNeeded(), eZDebug::updateSettings(), eZDebug::write(), eZAudit::writeAudit(), and eZDebug::writeFile().
| eZSys::setEnvironmentVariable | ( | $ | variableName, | |
| $ | variableValue | |||
| ) |
| eZSys::setIsDebugEnabled | ( | $ | debug | ) | [static] |
| eZSys::setServerVariable | ( | $ | variableName, | |
| $ | variableValue | |||
| ) |
| 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().
| eZSys::storageDirectory | ( | ) | [static] |
\ return the directory used for storing various kinds of files like images, audio and more. This will include the varDirectory().
Definition at line 483 of file ezsys.php.
Referenced by eZStylePackageCreator::commitCSSFile(), eZImageAliasHandler::generateXMLData(), eZImageAliasHandler::imagePath(), eZImageAliasHandler::imagePathByNode(), eZMediaType::insertRegularFile(), eZBinaryFileType::insertRegularFile(), eZHTTPFile::store(), eZMedia::storedFileInfo(), eZBinaryFile::storedFileInfo(), eZBinaryFileHandler::storedFilename(), eZMediaType::unserializeContentObjectAttribute(), eZBinaryFileType::unserializeContentObjectAttribute(), eZStylePackageCreator::validateImageFiles(), and eZPackageCreationHandler::validatePackageThumbnail().
| eZSys::varDirectory | ( | ) | [static] |
Definition at line 470 of file ezsys.php.
Referenced by eZWebDAVServer::appendLogEntry(), cacheDirectory(), eZDebug::printReport(), and storageDirectory().
| & eZSys::wwwDir | ( | ) | [static] |
The relative directory path of the vhless setup.
Definition at line 559 of file ezsys.php.
Referenced by attribute(), extension_path(), eZTemplateImageOperator::eZTemplateImageOperator(), eZRSSExport::fetchImageURL(), eZTemplatesStatisticsReporter::generateStatistics(), and eZUser::instance().
| eZSys::$AccessPath |
| eZSys::$EnvSeparator |
| eZSys::$FileSeparator |
| eZSys::$FileSystemType |
| eZSys::$RequestURI |
| eZSys::$ShellEscapeCharacter |
| eZSys::$WWWDir |
1.6.3