本文整理匯總了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));
}
}