本文整理汇总了PHP中Piwik\Db::isLockPrivilegeGranted方法的典型用法代码示例。如果您正苦于以下问题:PHP Db::isLockPrivilegeGranted方法的具体用法?PHP Db::isLockPrivilegeGranted怎么用?PHP Db::isLockPrivilegeGranted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Db
的用法示例。
在下文中一共展示了Db::isLockPrivilegeGranted方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDeleteTableLogTables
public static function getDeleteTableLogTables()
{
$result = Common::prefixTables('log_conversion', 'log_link_visit_action', 'log_visit', 'log_conversion_item');
if (Db::isLockPrivilegeGranted()) {
$result[] = Common::prefixTable('log_action');
}
return $result;
}
示例2: deleteUnusedLogActions
/**
* Deletes all unused entries from the log_action table. This method uses a temporary table to store used
* actions, and then deletes rows from log_action that are not in this temporary table.
*
* Table locking is required to avoid concurrency issues.
*
* @throws \Exception If table locking permission is not granted to the current MySQL user.
*/
public function deleteUnusedLogActions()
{
if (!Db::isLockPrivilegeGranted()) {
throw new \Exception("RawLogDao.deleteUnusedLogActions() requires table locking permission in order to complete without error.");
}
// get current max ID in log tables w/ idaction references.
$maxIds = $this->getMaxIdsInLogTables();
$this->createTempTableForStoringUsedActions();
// do large insert (inserting everything before maxIds) w/o locking tables...
$this->insertActionsToKeep($maxIds, $deleteOlderThanMax = true);
// ... then do small insert w/ locked tables to minimize the amount of time tables are locked.
$this->lockLogTables();
$this->insertActionsToKeep($maxIds, $deleteOlderThanMax = false);
// delete before unlocking tables so there's no chance a new log row that references an
// unused action will be inserted.
$this->deleteUnusedActions();
Db::unlockAllTables();
}
示例3: privacySettings
public function privacySettings()
{
Piwik::checkUserHasSomeAdminAccess();
$view = new View('@PrivacyManager/privacySettings');
if (Piwik::hasUserSuperUserAccess()) {
$view->deleteData = $this->getDeleteDataInfo();
$view->anonymizeIP = $this->getAnonymizeIPInfo();
$view->dntSupport = DoNotTrackHeaderChecker::isActive();
$view->canDeleteLogActions = Db::isLockPrivilegeGranted();
$view->dbUser = PiwikConfig::getInstance()->database['username'];
$view->deactivateNonce = Nonce::getNonce(self::DEACTIVATE_DNT_NONCE);
$view->activateNonce = Nonce::getNonce(self::ACTIVATE_DNT_NONCE);
}
$view->language = LanguagesManager::getLanguageCodeForCurrentUser();
$this->setBasicVariablesView($view);
return $view->render();
}
示例4: privacySettings
public function privacySettings()
{
Piwik::checkUserHasSomeAdminAccess();
$view = new View('@PrivacyManager/privacySettings');
if (Piwik::hasUserSuperUserAccess()) {
$view->deleteData = $this->getDeleteDataInfo();
$view->anonymizeIP = $this->getAnonymizeIPInfo();
$dntChecker = new DoNotTrackHeaderChecker();
$view->dntSupport = $dntChecker->isActive();
$view->canDeleteLogActions = Db::isLockPrivilegeGranted();
$view->dbUser = PiwikConfig::getInstance()->database['username'];
$view->deactivateNonce = Nonce::getNonce(self::DEACTIVATE_DNT_NONCE);
$view->activateNonce = Nonce::getNonce(self::ACTIVATE_DNT_NONCE);
$view->maskLengthOptions = array(array('key' => '1', 'value' => Piwik::translate('PrivacyManager_AnonymizeIpMaskLength', array("1", "192.168.100.xxx")), 'description' => ''), array('key' => '2', 'value' => Piwik::translate('PrivacyManager_AnonymizeIpMaskLength', array("2", "192.168.xxx.xxx")), 'description' => Piwik::translate('General_Recommended')), array('key' => '3', 'value' => Piwik::translate('PrivacyManager_AnonymizeIpMaskLength', array("3", "192.xxx.xxx.xxx")), 'description' => ''));
$view->useAnonymizedIpForVisitEnrichmentOptions = array(array('key' => '1', 'value' => Piwik::translate('General_Yes'), 'description' => Piwik::translate('PrivacyManager_RecommendedForPrivacy')), array('key' => '0', 'value' => Piwik::translate('General_No'), 'description' => ''));
$view->scheduleDeletionOptions = array(array('key' => '1', 'value' => Piwik::translate('Intl_PeriodDay')), array('key' => '7', 'value' => Piwik::translate('Intl_PeriodWeek')), array('key' => '30', 'value' => Piwik::translate('Intl_PeriodMonth')));
$view->doNotTrackOptions = array(array('key' => '1', 'value' => Piwik::translate('PrivacyManager_DoNotTrack_Enable'), 'description' => Piwik::translate('General_Recommended')), array('key' => '0', 'value' => Piwik::translate('PrivacyManager_DoNotTrack_Disable'), 'description' => Piwik::translate('General_NotRecommended')));
}
$view->language = LanguagesManager::getLanguageCodeForCurrentUser();
$this->setBasicVariablesView($view);
return $view->render();
}
示例5: getDeleteTableLogTables
public static function getDeleteTableLogTables()
{
$provider = StaticContainer::get('Piwik\\Plugin\\LogTablesProvider');
$result = array();
foreach ($provider->getAllLogTables() as $logTable) {
if ($logTable->getColumnToJoinOnIdVisit()) {
$result[] = Common::prefixTable($logTable->getName());
}
}
if (Db::isLockPrivilegeGranted()) {
$result[] = Common::prefixTable('log_action');
}
return $result;
}
示例6: deleteUnusedLogActions
/**
* Deletes all unused entries from the log_action table. This method uses a temporary table to store used
* actions, and then deletes rows from log_action that are not in this temporary table.
*
* Table locking is required to avoid concurrency issues.
*
* @throws \Exception If table locking permission is not granted to the current MySQL user.
*/
public function deleteUnusedLogActions()
{
if (!Db::isLockPrivilegeGranted()) {
throw new \Exception("RawLogDao.deleteUnusedLogActions() requires table locking permission in order to complete without error.");
}
$LogAction = Factory::getDAO('log_action');
$LogAction->purgeUnused($this->dimensionMetadataProvider);
}