本文整理汇总了PHP中eZDebug::writeWarning方法的典型用法代码示例。如果您正苦于以下问题:PHP eZDebug::writeWarning方法的具体用法?PHP eZDebug::writeWarning怎么用?PHP eZDebug::writeWarning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZDebug
的用法示例。
在下文中一共展示了eZDebug::writeWarning方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connect
function connect($server, $db, $user, $password, $socketPath, $charset = null, $port = false)
{
$connection = false;
if ($socketPath !== false) {
ini_set("mysqli.default_socket", $socketPath);
}
if ($this->UsePersistentConnection == true) {
// Only supported on PHP 5.3 (mysqlnd)
if (version_compare(PHP_VERSION, '5.3') > 0) {
$this->Server = 'p:' . $this->Server;
} else {
eZDebug::writeWarning('mysqli only supports persistent connections when using php 5.3 and higher', 'eZMySQLiDB::connect');
}
}
eZPerfLogger::accumulatorStart('mysqli_connection', 'mysqli_total', 'Database connection');
$connection = mysqli_connect($server, $user, $password, null, (int) $port, $socketPath);
$dbErrorText = mysqli_connect_error();
eZPerfLogger::accumulatorStop('mysqli_connection');
$maxAttempts = $this->connectRetryCount();
$waitTime = $this->connectRetryWaitTime();
$numAttempts = 1;
while (!$connection && $numAttempts <= $maxAttempts) {
sleep($waitTime);
eZPerfLogger::accumulatorStart('mysqli_connection', 'mysqli_total', 'Database connection');
$connection = mysqli_connect($this->Server, $this->User, $this->Password, null, (int) $this->Port, $this->SocketPath);
eZPerfLogger::accumulatorStop('mysqli_connection');
$numAttempts++;
}
$this->setError();
$this->IsConnected = true;
if (!$connection) {
eZDebug::writeError("Connection error: Couldn't connect to database. Please try again later or inform the system administrator.\n{$dbErrorText}", __CLASS__);
$this->IsConnected = false;
throw new eZDBNoConnectionException($server);
}
if ($this->IsConnected && $db != null) {
eZPerfLogger::accumulatorStart('mysqli_connection', 'mysqli_total', 'Database connection');
$ret = mysqli_select_db($connection, $db);
eZPerfLogger::accumulatorStop('mysqli_connection');
if (!$ret) {
//$this->setError();
eZDebug::writeError("Connection error: " . mysqli_errno($connection) . ": " . mysqli_error($connection), "eZMySQLiDB");
$this->IsConnected = false;
}
}
if ($charset !== null) {
$originalCharset = $charset;
$charset = eZCharsetInfo::realCharsetCode($charset);
}
if ($this->IsConnected and $charset !== null) {
eZPerfLogger::accumulatorStart('mysqli_connection', 'mysqli_total', 'Database connection');
$status = mysqli_set_charset($connection, eZMySQLCharset::mapTo($charset));
eZPerfLogger::accumulatorStop('mysqli_connection');
if (!$status) {
$this->setError();
eZDebug::writeWarning("Connection warning: " . mysqli_errno($connection) . ": " . mysqli_error($connection), "eZMySQLiDB");
}
}
return $connection;
}
示例2: execute
function execute($process, $event)
{
$parameters = $process->attribute('parameter_list');
$http = eZHTTPTool::instance();
eZDebug::writeNotice($parameters, "parameters");
$orderID = $parameters['order_id'];
$order = eZOrder::fetch($orderID);
if (empty($orderID) || get_class($order) != 'ezorder') {
eZDebug::writeWarning("Can't proceed without a Order ID.", "SimpleStockCheck");
return eZWorkflowEventType::STATUS_FETCH_TEMPLATE_REPEAT;
}
// Decrement the quantitity field
$order = eZOrder::fetch($orderID);
$productCollection = $order->productCollection();
$ordereditems = $productCollection->itemList();
foreach ($ordereditems as $item) {
$contentObject = $item->contentObject();
$contentObjectVersion = $contentObject->version($contentObject->attribute('current_version'));
$contentObjectAttributes = $contentObjectVersion->contentObjectAttributes();
foreach (array_keys($contentObjectAttributes) as $key) {
$contentObjectAttribute = $contentObjectAttributes[$key];
$contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
// Each attribute has an attribute identifier called 'quantity' that identifies it.
if ($contentClassAttribute->attribute("identifier") == "quantity") {
$contentObjectAttribute->setAttribute("data_int", $contentObjectAttribute->attribute("value") - $item->ItemCount);
$contentObjectAttribute->store();
}
}
}
return eZWorkflowEventType::STATUS_ACCEPTED;
}
示例3: getScmInfo
/**
* @todo add support for SVN
* @return array each element is an array with information
*/
public static function getScmInfo()
{
$dirs = self::getScmDir();
if (!$dirs) {
return array();
}
if (is_string($dirs)) {
$dirs = array($dirs);
}
$out = array();
foreach ($dirs as $name => $dir) {
if (!is_dir($dir)) {
eZDebug::writeWarning("'{$dir}' is not a directory, can not get SCM info", __METHOD__);
continue;
}
$revisionInfo = array();
exec("cd {$dir} && git log -1", $revisionInfo, $retcode);
$statusInfo = array();
exec("cd {$dir} && git status", $statusInfo, $retcode);
$tagInfo = array();
exec("cd {$dir} && git describe", $tagInfo, $retcode);
$out[$name] = array('revision_info' => $revisionInfo, 'status_info' => $statusInfo, 'tag_info' => $tagInfo);
}
return $out;
}
示例4: __construct
function __construct($id, $createIfNotExists = false, $options = array(), $remoteUrl = null)
{
$this->notifications = array(self::ERROR => array(), self::WARNING => array(), self::NOTICE => array());
if ($remoteUrl !== NULL) {
self::setRemoteUrl($remoteUrl);
}
$class = eZContentClass::fetch(intval($id));
$this->options = $options;
$this->data = new stdClass();
if (!$class instanceof eZContentClass) {
$class = eZContentClass::fetchByIdentifier($id);
}
if (!$class instanceof eZContentClass) {
if (!$createIfNotExists) {
throw new Exception("Classe {$id} non trovata");
} else {
if (!is_numeric($id)) {
eZDebug::writeWarning("Creazione della classe {$id}");
$class = $this->createNew($id);
if (!$class instanceof eZContentClass) {
throw new Exception("Fallita la creazionde della classe {$id}");
}
} else {
throw new Exception("Per creare automaticamente una nuova classe è necessario fornire l'identificativo e non l'id numerico");
}
}
}
$this->currentClass = $class;
$this->id = $this->currentClass->attribute('id');
$this->identifier = $this->currentClass->attribute('identifier');
}
示例5: filterQueryParams
/**
* Modifies SolR query params according to filter parameters
* @param array $queryParams
* @param array $filterParams
* @return array $queryParams
*/
public function filterQueryParams(array $queryParams, array $filterParams)
{
try {
if (!isset($filterParams['field'])) {
throw new Exception('Missing filter parameter "field"');
}
if (!isset($filterParams['latitude'])) {
throw new Exception('Missing filter parameter "latitude"');
}
if (!isset($filterParams['longitude'])) {
throw new Exception('Missing filter parameter "longitude"');
}
$fieldName = eZSolr::getFieldName($filterParams['field']);
//geodist custom parameters
$queryParams['sfield'] = $fieldName;
$queryParams['pt'] = $filterParams['latitude'] . ',' . $filterParams['longitude'];
//sort by geodist
$queryParams['sort'] = 'geodist() asc,' . $queryParams['sort'];
//exclude unlocated documents
$queryParams['fq'][] = $fieldName . ':[-90,-90 TO 90,90]';
} catch (Exception $e) {
eZDebug::writeWarning($e->getMessage(), __CLASS__);
}
return $queryParams;
}
示例6: updateAutoload
function updateAutoload($tpl = null)
{
$autoloadGenerator = new eZAutoloadGenerator();
try {
$autoloadGenerator->buildAutoloadArrays();
$messages = $autoloadGenerator->getMessages();
foreach ($messages as $message) {
eZDebug::writeNotice($message, 'eZAutoloadGenerator');
}
$warnings = $autoloadGenerator->getWarnings();
foreach ($warnings as &$warning) {
eZDebug::writeWarning($warning, "eZAutoloadGenerator");
// For web output we want to mark some of the important parts of
// the message
$pattern = '@^Class\\s+(\\w+)\\s+.* file\\s(.+\\.php).*\\n(.+\\.php)\\s@';
preg_match($pattern, $warning, $m);
$warning = str_replace($m[1], '<strong>' . $m[1] . '</strong>', $warning);
$warning = str_replace($m[2], '<em>' . $m[2] . '</em>', $warning);
$warning = str_replace($m[3], '<em>' . $m[3] . '</em>', $warning);
}
if ($tpl !== null) {
$tpl->setVariable('warning_messages', $warnings);
}
} catch (Exception $e) {
eZDebug::writeError($e->getMessage());
}
}
示例7: _exclusiveLock
function _exclusiveLock($fname = false)
{
$mutex =& $this->_mutex();
while (true) {
$timestamp = $mutex->lockTS();
// Note: This does not lock, only checks what the timestamp is.
if ($timestamp === false) {
if (!$mutex->lock()) {
eZDebug::writeWarning("Failed to acquire lock for file " . $this->filePath);
return false;
}
$mutex->setMeta('pid', getmypid());
return true;
}
if ($timestamp >= time() - $this->lifetime) {
usleep(500000);
// Sleep 0.5 second
continue;
}
$oldPid = $mutex->meta('pid');
if (is_numeric($oldPid) && $oldPid != 0 && function_exists('posix_kill')) {
posix_kill($oldPid, 9);
}
if (!$mutex->steal()) {
eZDebug::writeWarning("Failed to steal lock for file " . $this->filePath . " from PID {$oldPid}");
return false;
}
$mutex->setMeta('pid', getmypid());
return true;
}
}
示例8: run
function run( &$benchmark, $display = false )
{
$this->Results = array();
$this->CurrentResult = false;
if ( is_subclass_of( $benchmark, 'ezbenchmarkunit' ) )
{
$markList = $benchmark->markList();
foreach ( $markList as $mark )
{
$type = $this->markEntryType( $benchmark, $mark );
if ( $type )
{
$mark['type'] = $type;
$this->prepareMarkEntry( $benchmark, $mark );
$this->runMarkEntry( $benchmark, $mark );
$this->finalizeMarkEntry( $benchmark, $mark, $display );
}
else
$this->addToCurrentResult( $mark,
"Unknown mark type for mark " . $benchmark->name() . '::' . $mark['name'] );
}
}
else
{
eZDebug::writeWarning( "Tried to run test on an object which is not subclassed from eZBenchmarkCase", __METHOD__ );
}
}
示例9: runFile
function runFile( $Params, $file, $params_as_var )
{
$Result = null;
if ( $params_as_var )
{
foreach ( $Params as $key => $dummy )
{
if ( $key != "Params" and
$key != "this" and
$key != "file" and
!is_numeric( $key ) )
{
${$key} = $Params[$key];
}
}
}
if ( file_exists( $file ) )
{
$includeResult = include( $file );
if ( empty( $Result ) &&
$includeResult != 1 )
{
$Result = $includeResult;
}
}
else
eZDebug::writeWarning( "PHP script $file does not exist, cannot run.",
"eZProcess" );
return $Result;
}
示例10: execute
function execute($process, $event)
{
// get object being published
$parameters = $process->attribute('parameter_list');
$objectID = $parameters['object_id'];
eZDebug::writeDebug('Update object state for object: ' . $objectID);
$object = eZContentObject::fetch($objectID);
$state_before = $event->attribute('state_before');
$state_after = $event->attribute('state_after');
if ($object == null) {
eZDebug::writeError('Update object state failed for inexisting object: ' . $objectID, __METHOD__);
return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
}
if ($state_before == null || $state_after == null) {
eZDebug::writeError('Update object state failed: badly configured states', __METHOD__);
return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
}
$currentStateIDArray = $object->attribute('state_id_array');
if (in_array($state_before->attribute('id'), $currentStateIDArray)) {
$canAssignStateIDList = $object->attribute('allowed_assign_state_id_list');
if (!in_array($state_after->attribute('id'), $canAssignStateIDList)) {
eZDebug::writeWarning("Not enough rights to assign state to object {$objectID}: " . $state_after->attribute('id'), __METHOD__);
} else {
eZDebug::writeDebug('Changing object state from ' . $state_before->attribute('name') . ' to ' . $state_after->attribute('name'), __METHOD__);
if (eZOperationHandler::operationIsAvailable('content_updateobjectstate')) {
$operationResult = eZOperationHandler::execute('content', 'updateobjectstate', array('object_id' => $objectID, 'state_id_list' => array($state_after->attribute('id'))));
} else {
eZContentOperationCollection::updateObjectState($objectID, array($state_after->attribute('id')));
}
}
}
return eZWorkflowType::STATUS_ACCEPTED;
}
示例11: attribute
function attribute($name)
{
switch ($name) {
case 'input_xml':
return $this->inputXML();
break;
case 'edit_template_name':
return $this->editTemplateName();
break;
case 'information_template_name':
return $this->informationTemplateName();
break;
case 'aliased_type':
eZDebug::writeWarning("'aliased_type' is deprecated as of 4.1 and not in use anymore, meaning it will always return false.", __METHOD__);
return $this->AliasedType;
break;
case 'aliased_handler':
if ($this->AliasedHandler === null) {
$this->AliasedHandler = eZXMLText::inputHandler($this->XMLData, $this->AliasedType, false, $this->ContentObjectAttribute);
}
return $this->AliasedHandler;
break;
default:
eZDebug::writeError("Attribute '{$name}' does not exist", __METHOD__);
return null;
break;
}
}
示例12: getInstance
/**
* Get singleton instance for filter
* @param string $filterID
* @return eZFindExtendedAttributeFilterInterface|false
*/
public static function getInstance($filterID)
{
if (!isset(self::$instances[$filterID])) {
try {
if (!self::$filtersList) {
$ini = eZINI::instance('ezfind.ini');
self::$filtersList = $ini->variable('ExtendedAttributeFilters', 'FiltersList');
}
if (!isset(self::$filtersList[$filterID])) {
throw new Exception($filterID . ' extended attribute filter is not defined');
}
$className = self::$filtersList[$filterID];
if (!class_exists($className)) {
throw new Exception('Could not find class ' . $className);
}
$instance = new $className();
if (!$instance instanceof eZFindExtendedAttributeFilterInterface) {
throw new Exception($className . ' is not a valid eZFindExtendedAttributeFilterInterface');
}
self::$instances[$filterID] = $instance;
} catch (Exception $e) {
eZDebug::writeWarning($e->getMessage(), __METHOD__);
self::$instances[$filterID] = false;
}
}
return self::$instances[$filterID];
}
示例13: getVAT
/**
* Get percentage of VAT type corresponding to the given product and country the user is from.
*
* \return Percentage, or null on error.
* \public
* \static
*/
static function getVAT( $object, $country )
{
// Load VAT handler.
if ( !is_object( $handler = eZVATManager::loadVATHandler() ) )
{
if ( $handler === true )
{
eZDebug::writeWarning( "No VAT handler specified but dynamic VAT charging is used." );
}
return null;
}
// Check if user country must be specified.
$requireUserCountry = eZVATManager::isUserCountryRequired();
// Determine user country if it's not specified
if ( $country === false )
$country = eZVATManager::getUserCountry();
if ( !$country && $requireUserCountry )
{
eZDebug::writeNotice( "User country is not specified." );
}
return $handler->getVatPercent( $object, $country );
}
示例14: sendMail
function sendMail(eZMail $mail)
{
$ini = eZINI::instance();
$sendmailOptions = '';
$emailFrom = $mail->sender();
$emailSender = isset($emailFrom['email']) ? $emailFrom['email'] : false;
if (!$emailSender || count($emailSender) <= 0) {
$emailSender = $ini->variable('MailSettings', 'EmailSender');
}
if (!$emailSender) {
$emailSender = $ini->variable('MailSettings', 'AdminEmail');
}
if (!eZMail::validate($emailSender)) {
$emailSender = false;
}
$isSafeMode = ini_get('safe_mode') != 0;
$sendmailOptionsArray = $ini->variable('MailSettings', 'SendmailOptions');
if (is_array($sendmailOptionsArray)) {
$sendmailOptions = implode(' ', $sendmailOptionsArray);
} elseif (!is_string($sendmailOptionsArray)) {
$sendmailOptions = $sendmailOptionsArray;
}
if (!$isSafeMode and $emailSender) {
$sendmailOptions .= ' -f' . $emailSender;
}
if ($isSafeMode and $emailSender and $mail->sender() == false) {
$mail->setSenderText($emailSender);
}
if (function_exists('mail')) {
$message = $mail->body();
$sys = eZSys::instance();
$excludeHeaders = array('Subject');
// If not Windows PHP mail() implementation, we can not specify a To: header in the $additional_headers parameter,
// because then there will be 2 To: headers in the resulting e-mail.
// However, we can use "undisclosed-recipients:;" in $to.
if ($sys->osType() != 'win32') {
$excludeHeaders[] = 'To';
$receiverEmailText = count($mail->ReceiverElements) > 0 ? $mail->receiverEmailText() : 'undisclosed-recipients:;';
} else {
$receiverEmailText = $mail->receiverEmailText();
}
// If in debug mode, send to debug email address and nothing else
if ($ini->variable('MailSettings', 'DebugSending') == 'enabled') {
$receiverEmailText = $ini->variable('MailSettings', 'DebugReceiverEmail');
$excludeHeaders[] = 'To';
$excludeHeaders[] = 'Cc';
$excludeHeaders[] = 'Bcc';
}
$extraHeaders = $mail->headerText(array('exclude-headers' => $excludeHeaders));
$returnedValue = mail($receiverEmailText, $mail->subject(), $message, $extraHeaders, $sendmailOptions);
if ($returnedValue === false) {
eZDebug::writeError('An error occurred while sending e-mail. Check the Sendmail error message for further information (usually in /var/log/messages)', __METHOD__);
}
return $returnedValue;
} else {
eZDebug::writeWarning("Unable to send mail: 'mail' function is not compiled into PHP.", __METHOD__);
}
return false;
}
示例15: fetchList
/**
* Return a list of all cache items in the system.
*
* @return array The list of cache items
*/
static function fetchList()
{
static $cacheList = null;
if ($cacheList === null) {
$ini = eZINI::instance();
$textToImageIni = eZINI::instance('texttoimage.ini');
$cacheList = array(array('name' => ezpI18n::tr('kernel/cache', 'Content view cache'), 'id' => 'content', 'is-clustered' => true, 'tag' => array('content'), 'expiry-key' => 'content-view-cache', 'enabled' => $ini->variable('ContentSettings', 'ViewCaching') == 'enabled', 'path' => $ini->variable('ContentSettings', 'CacheDir'), 'function' => array('eZCache', 'clearContentCache')), array('name' => ezpI18n::tr('kernel/cache', 'Global INI cache'), 'id' => 'global_ini', 'tag' => array('ini'), 'enabled' => true, 'path' => 'var/cache/ini', 'function' => array('eZCache', 'clearGlobalINICache'), 'purge-function' => array('eZCache', 'clearGlobalINICache')), array('name' => ezpI18n::tr('kernel/cache', 'INI cache'), 'id' => 'ini', 'tag' => array('ini'), 'enabled' => true, 'path' => 'ini'), array('name' => ezpI18n::tr('kernel/cache', 'Codepage cache'), 'id' => 'codepage', 'tag' => array('codepage'), 'enabled' => true, 'path' => 'codepages'), array('name' => ezpI18n::tr('kernel/cache', 'Class identifier cache'), 'id' => 'classid', 'tag' => array('content'), 'expiry-key' => 'class-identifier-cache', 'enabled' => true, 'path' => false, 'is-clustered' => true, 'function' => array('eZCache', 'clearClassID'), 'purge-function' => array('eZCache', 'clearClassID')), array('name' => ezpI18n::tr('kernel/cache', 'Sort key cache'), 'id' => 'sortkey', 'tag' => array('content'), 'expiry-key' => 'sort-key-cache', 'enabled' => true, 'path' => false, 'function' => array('eZCache', 'clearSortKey'), 'purge-function' => array('eZCache', 'clearSortKey'), 'is-clustered' => true), array('name' => ezpI18n::tr('kernel/cache', 'URL alias cache'), 'id' => 'urlalias', 'is-clustered' => true, 'tag' => array('content'), 'enabled' => true, 'path' => 'wildcard'), array('name' => ezpI18n::tr('kernel/cache', 'Character transformation cache'), 'id' => 'chartrans', 'tag' => array('i18n'), 'enabled' => true, 'path' => 'trans'), array('name' => ezpI18n::tr('kernel/cache', 'Image alias'), 'id' => 'imagealias', 'tag' => array('image'), 'path' => false, 'enabled' => true, 'function' => array('eZCache', 'clearImageAlias'), 'purge-function' => array('eZCache', 'purgeImageAlias'), 'is-clustered' => true), array('name' => ezpI18n::tr('kernel/cache', 'Template cache'), 'id' => 'template', 'tag' => array('template'), 'enabled' => $ini->variable('TemplateSettings', 'TemplateCompile') == 'enabled', 'path' => 'template'), array('name' => ezpI18n::tr('kernel/cache', 'Template block cache'), 'id' => 'template-block', 'is-clustered' => true, 'tag' => array('template', 'content'), 'expiry-key' => 'global-template-block-cache', 'enabled' => $ini->variable('TemplateSettings', 'TemplateCache') == 'enabled', 'path' => 'template-block', 'function' => array('eZCache', 'clearTemplateBlockCache')), array('name' => ezpI18n::tr('kernel/cache', 'Template override cache'), 'id' => 'template-override', 'tag' => array('template'), 'enabled' => true, 'path' => 'override', 'function' => array('eZCache', 'clearTemplateOverrideCache')), array('name' => ezpI18n::tr('kernel/cache', 'Text to image cache'), 'id' => 'texttoimage', 'tag' => array('template'), 'enabled' => $textToImageIni->variable('ImageSettings', 'UseCache') == 'enabled', 'path' => $textToImageIni->variable('PathSettings', 'CacheDir'), 'function' => array('eZCache', 'clearTextToImageCache'), 'purge-function' => array('eZCache', 'purgeTextToImageCache'), 'is-clustered' => true), array('name' => ezpI18n::tr('kernel/cache', 'RSS cache'), 'id' => 'rss_cache', 'is-clustered' => true, 'tag' => array('content'), 'enabled' => true, 'path' => 'rss'), array('name' => ezpI18n::tr('kernel/cache', 'User info cache'), 'id' => 'user_info_cache', 'is-clustered' => true, 'tag' => array('user'), 'expiry-key' => 'user-info-cache', 'enabled' => true, 'path' => 'user-info', 'function' => array('eZCache', 'clearUserInfoCache')), array('name' => ezpI18n::tr('kernel/cache', 'Content tree menu (browser cache)'), 'id' => 'content_tree_menu', 'tag' => array('content'), 'path' => false, 'enabled' => true, 'function' => array('eZCache', 'clearContentTreeMenu'), 'purge-function' => array('eZCache', 'clearContentTreeMenu')), array('name' => ezpI18n::tr('kernel/cache', 'State limitations cache'), 'is-clustered' => true, 'id' => 'state_limitations', 'tag' => array('content'), 'expiry-key' => 'state-limitations', 'enabled' => true, 'path' => false, 'function' => array('eZCache', 'clearStateLimitations'), 'purge-function' => array('eZCache', 'clearStateLimitations')), array('name' => ezpI18n::tr('kernel/cache', 'Design base cache'), 'id' => 'design_base', 'tag' => array('template'), 'enabled' => $ini->variable('DesignSettings', 'DesignLocationCache') == 'enabled', 'path' => false, 'function' => array('eZCache', 'clearDesignBaseCache'), 'purge-function' => array('eZCache', 'clearDesignBaseCache')), array('name' => ezpI18n::tr('kernel/cache', 'Active extensions cache'), 'id' => 'active_extensions', 'tag' => array('ini'), 'expiry-key' => 'active-extensions-cache', 'enabled' => true, 'path' => false, 'function' => array('eZCache', 'clearActiveExtensions'), 'purge-function' => array('eZCache', 'clearActiveExtensions')), array('name' => ezpI18n::tr('kernel/cache', 'TS Translation cache'), 'id' => 'translation', 'tag' => array('i18n'), 'enabled' => true, 'expiry-key' => 'ts-translation-cache', 'path' => 'translation', 'function' => array('eZCache', 'clearTSTranslationCache')), array('name' => ezpI18n::tr('kernel/cache', 'SSL Zones cache'), 'id' => 'sslzones', 'tag' => array('ini'), 'enabled' => eZSSLZone::enabled(), 'path' => false, 'function' => array('eZSSLZone', 'clearCache'), 'purge-function' => array('eZSSLZone', 'clearCache')));
// Append cache items defined (in ini) by extensions, see site.ini[Cache] for details
foreach ($ini->variable('Cache', 'CacheItems') as $cacheItemKey) {
$name = 'Cache_' . $cacheItemKey;
if (!$ini->hasSection($name)) {
eZDebug::writeWarning("Missing site.ini section: '{$name}', skipping!", __METHOD__);
continue;
}
$cacheItem = array();
if ($ini->hasVariable($name, 'name')) {
$cacheItem['name'] = $ini->variable($name, 'name');
} else {
$cacheItem['name'] = ucwords($cacheItemKey);
}
if ($ini->hasVariable($name, 'id')) {
$cacheItem['id'] = $ini->variable($name, 'id');
} else {
$cacheItem['id'] = $cacheItemKey;
}
if ($ini->hasVariable($name, 'isClustered')) {
$cacheItem['is-clustered'] = $ini->variable($name, 'isClustered');
} else {
$cacheItem['is-clustered'] = false;
}
if ($ini->hasVariable($name, 'tags')) {
$cacheItem['tag'] = $ini->variable($name, 'tags');
} else {
$cacheItem['tag'] = array();
}
if ($ini->hasVariable($name, 'expiryKey')) {
$cacheItem['expiry-key'] = $ini->variable($name, 'expiryKey');
}
if ($ini->hasVariable($name, 'enabled')) {
$cacheItem['enabled'] = $ini->variable($name, 'enabled');
} else {
$cacheItem['enabled'] = true;
}
if ($ini->hasVariable($name, 'path')) {
$cacheItem['path'] = $ini->variable($name, 'path');
} else {
$cacheItem['path'] = false;
}
if ($ini->hasVariable($name, 'class')) {
$cacheItem['function'] = array($ini->variable($name, 'class'), 'clearCache');
}
if ($ini->hasVariable($name, 'purgeClass')) {
$cacheItem['purge-function'] = array($ini->variable($name, 'purgeClass'), 'purgeCache');
}
$cacheList[] = $cacheItem;
}
}
return $cacheList;
}