当前位置: 首页>>代码示例>>PHP>>正文


PHP Db::isLockPrivilegeGranted方法代码示例

本文整理汇总了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;
 }
开发者ID:bossrabbit,项目名称:piwik,代码行数:8,代码来源:LogDataPurger.php

示例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();
 }
开发者ID:CaptainSharf,项目名称:SSAD_Project,代码行数:26,代码来源:RawLogDao.php

示例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();
 }
开发者ID:emersonmatsumoto,项目名称:piwik,代码行数:17,代码来源:Controller.php

示例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();
 }
开发者ID:piwik,项目名称:piwik,代码行数:22,代码来源:Controller.php

示例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;
 }
开发者ID:diosmosis,项目名称:piwik,代码行数:14,代码来源:LogDataPurger.php

示例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);
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:16,代码来源:RawLogDao.php


注:本文中的Piwik\Db::isLockPrivilegeGranted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。