示例#1
0
 /**
  * Returns an array describing what data would be purged if both log data & report
  * purging is invoked.
  * 
  * The returned array maps table names with the number of rows that will be deleted.
  * If the table name is mapped with -1, the table will be dropped.
  * 
  * @param array $settings The config options to use in the estimate. If null, the real
  *                        options are used.
  * @return array
  */
 public static function getPurgeEstimate($settings = null)
 {
     if (is_null($settings)) {
         $settings = self::getPurgeDataSettings();
     }
     $result = array();
     if ($settings['delete_logs_enable']) {
         $logDataPurger = Piwik_PrivacyManager_LogDataPurger::make($settings);
         $result = array_merge($result, $logDataPurger->getPurgeEstimate());
     }
     if ($settings['delete_reports_enable']) {
         $reportsPurger = Piwik_PrivacyManager_ReportsPurger::make($settings, self::getAllMetricsToKeep());
         $result = array_merge($result, $reportsPurger->getPurgeEstimate());
     }
     return $result;
 }