original_string: public function executeDataPurge()
      {
          $this->checkDataPurgeAdminSettingsIsEnabled();
  
          Piwik::checkUserHasSuperUserAccess();
          $this->checkTokenInUrl();
  
          // if the request isn't a POST, redirect to index
          if ($_SERVER["REQUEST_METHOD"] != "POST"
              && !Common::isPhpCliMode()
          ) {
              $this->redirectToIndex('PrivacyManager', 'privacySettings');
              return;
          }
  
          $settings = PrivacyManager::getPurgeDataSettings();
          if ($settings['delete_logs_enable']) {
              /** @var LogDataPurger $logDataPurger */
              $logDataPurger = StaticContainer::get('Piwik\Plugins\PrivacyManager\LogDataPurger');
              $logDataPurger->purgeData($settings['delete_logs_older_than'], true);
          }
          if ($settings['delete_reports_enable']) {
              $reportsPurger = ReportsPurger::make($settings, PrivacyManager::getAllMetricsToKeep());
              $reportsPurger->purgeData(true);
          }
      }
code: public function executeDataPurge()
      {
          $this->checkDataPurgeAdminSettingsIsEnabled();
  
          Piwik::checkUserHasSuperUserAccess();
          $this->checkTokenInUrl();
  
          // if the request isn't a POST, redirect to index
          if ($_SERVER["REQUEST_METHOD"] != "POST"
              && !Common::isPhpCliMode()
          ) {
              $this->redirectToIndex('PrivacyManager', 'privacySettings');
              return;
          }
  
          $settings = PrivacyManager::getPurgeDataSettings();
          if ($settings['delete_logs_enable']) {
              /** @var LogDataPurger $logDataPurger */
              $logDataPurger = StaticContainer::get('Piwik\Plugins\PrivacyManager\LogDataPurger');
              $logDataPurger->purgeData($settings['delete_logs_older_than'], true);
          }
          if ($settings['delete_reports_enable']) {
              $reportsPurger = ReportsPurger::make($settings, PrivacyManager::getAllMetricsToKeep());
              $reportsPurger->purgeData(true);
          }
      }
code_tokens: public function executeDataPurge ( ) { $ this -> checkDataPurgeAdminSettingsIsEnabled ( ) ; Piwik :: checkUserHasSuperUserAccess ( ) ; $ this -> checkTokenInUrl ( ) ; // if the request isn't a POST, redirect to index if ( $ _SERVER [ "REQUEST_METHOD" ] != "POST" && ! Common :: isPhpCliMode ( ) ) { $ this -> redirectToIndex ( 'PrivacyManager' , 'privacySettings' ) ; return ; } $ settings = PrivacyManager :: getPurgeDataSettings ( ) ; if ( $ settings [ 'delete_logs_enable' ] ) { /** @var LogDataPurger $logDataPurger */ $ logDataPurger = StaticContainer :: get ( 'Piwik\Plugins\PrivacyManager\LogDataPurger' ) ; $ logDataPurger -> purgeData ( $ settings [ 'delete_logs_older_than' ] , true ) ; } if ( $ settings [ 'delete_reports_enable' ] ) { $ reportsPurger = ReportsPurger :: make ( $ settings , PrivacyManager :: getAllMetricsToKeep ( ) ) ; $ reportsPurger -> purgeData ( true ) ; } }
docstring: Executes a data purge, deleting raw data and report data using the current config
  options. Echo's the result of getDatabaseSize after purging.
docstring_tokens: Executes a data purge deleting raw data and report data using the current config options . Echo s the result of getDatabaseSize after purging .