本文整理汇总了PHP中CPHPCache::cleanDir方法的典型用法代码示例。如果您正苦于以下问题:PHP CPHPCache::cleanDir方法的具体用法?PHP CPHPCache::cleanDir怎么用?PHP CPHPCache::cleanDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPHPCache
的用法示例。
在下文中一共展示了CPHPCache::cleanDir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: merge
public static function merge($data)
{
static $connection = false;
static $helper = false;
if (!$connection) {
$connection = \Bitrix\Main\Application::getConnection();
$helper = $connection->getSqlHelper();
}
$userId = isset($data['USER_ID']) && intval($data['USER_ID']) > 0 ? intval($data['USER_ID']) : $GLOBALS['USER']->getId();
if (is_array($data['CODE'])) {
$dataModified = $data;
foreach ($data['CODE'] as $code) {
$dataModified['CODE'] = $code;
FinderDestTable::merge($dataModified);
}
return;
} else {
$insertFields = array('USER_ID' => $userId, 'CODE' => strtoupper($data['CODE']), 'CONTEXT' => isset($data['CONTEXT']) ? strtoupper($data['CONTEXT']) : '', 'LAST_USE_DATE' => new \Bitrix\Main\DB\SqlExpression($helper->getCurrentDateTimeFunction()));
if (preg_match('/^U(\\d+)$/i', $data['CODE'], $matches)) {
$insertFields['CODE_USER_ID'] = intval($matches[1]);
$insertFields['CODE_TYPE'] = 'U';
} elseif (preg_match('/^SG(\\d+)$/i', $data['CODE'], $matches)) {
$insertFields['CODE_TYPE'] = 'SG';
} elseif (preg_match('/^D(\\d+)$/i', $data['CODE'], $matches) || preg_match('/^DR(\\d+)$/i', $data['CODE'], $matches)) {
$insertFields['CODE_TYPE'] = 'D';
} elseif (preg_match('/^CRMCONTACT(\\d+)$/i', $data['CODE'], $matches) || preg_match('/^CRMCOMPANY(\\d+)$/i', $data['CODE'], $matches) || preg_match('/^CRMDEAL(\\d+)$/i', $data['CODE'], $matches) || preg_match('/^CRMLEAD(\\d+)$/i', $data['CODE'], $matches)) {
$insertFields['CODE_TYPE'] = 'CRM';
}
$merge = $helper->prepareMerge('b_finder_dest', array('USER_ID', 'CODE'), $insertFields, array('LAST_USE_DATE' => new \Bitrix\Main\DB\SqlExpression($helper->getCurrentDateTimeFunction())));
if ($merge[0] != "") {
$connection->query($merge[0]);
}
$cache = new \CPHPCache();
$cache->cleanDir('/sonet/log_dest_sort/' . intval($userId / 100));
}
}