Example #1
0
 private function lockLogTables()
 {
     Piwik_LockTables($readLocks = Piwik_Common::prefixTables('log_conversion', 'log_link_visit_action', 'log_visit', 'log_conversion_item'), $writeLocks = Piwik_Common::prefixTables('log_action'));
 }
Example #2
0
 /**
  * Checks whether the database user is allowed to lock tables.
  * 
  * @return bool
  */
 public static function isLockPrivilegeGranted()
 {
     if (is_null(self::$lockPrivilegeGranted)) {
         try {
             Piwik_LockTables(Piwik_Common::prefixTable('log_visit'));
             Piwik_UnlockAllTables();
             self::$lockPrivilegeGranted = true;
         } catch (Exception $ex) {
             self::$lockPrivilegeGranted = false;
         }
     }
     return self::$lockPrivilegeGranted;
 }