diff --git a/core/CronArchive.php b/core/CronArchive.php index e1b9b8f7319313cb499527344b1deff8a30e1c27..96f5566e42515a1faea647f2660ef3ed0bac800e 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -520,7 +520,7 @@ class CronArchive private function initSegmentsToArchive() { - $segments = APICoreAdminHome::getInstance()->getKnownSegmentsToArchive(); + $segments = \Piwik\SettingsPiwik::getKnownSegmentsToArchive(); if (empty($segments)) { return array(); } diff --git a/misc/cron/archive.sh b/misc/cron/archive.sh index 59af4660b59a36ea419aee69f9f584df9546d978..6fc4a9c1bcc7338a8773ffe8f9756447a813fc86 100755 --- a/misc/cron/archive.sh +++ b/misc/cron/archive.sh @@ -70,9 +70,6 @@ TOKEN_AUTH=`cat $FILENAME_TOKEN_CONTENT | cut -f2` CMD_GET_ID_SITES="$PHP_BIN -q $PIWIK_PATH -- module=API&method=SitesManager.getAllSitesId&token_auth=$TOKEN_AUTH&format=csv&convertToUnicode=0" ID_SITES=`$CMD_GET_ID_SITES` -CMD_GET_SEGMENTS_TO_ARCHIVE="$PHP_BIN -q $PIWIK_PATH -- module=API&method=CoreAdminHome.getKnownSegmentsToArchive&token_auth=$TOKEN_AUTH&format=csv&convertToUnicode=0" -SEGMENTS_TO_ARCHIVE=`$CMD_GET_SEGMENTS_TO_ARCHIVE` - echo "Starting Piwik reports archiving..." echo "" for idsite in $ID_SITES; do @@ -84,21 +81,6 @@ for idsite in $ID_SITES; do CMD="$PHP_BIN -q $PIWIK_PATH -- module=API&method=VisitsSummary.getVisits&idSite=$idsite&period=$period&date=last52&format=xml&token_auth=$TOKEN_AUTH" $CMD - for segment in $SEGMENTS_TO_ARCHIVE; do - if test $segment != "value"; then - # Ignore "No data available" response when there are no segment to pre-process - if test $segment != "No"; then - if test $segment != "data"; then - if test $segment != "available"; then - echo "" - echo " - Archiving for visitor segment $segment ..." - CMD_ARCHIVE_SEGMENT="${CMD}&segment=$segment" - $CMD_ARCHIVE_SEGMENT - fi - fi - fi - fi - done done echo "" diff --git a/plugins/CoreAdminHome/API.php b/plugins/CoreAdminHome/API.php index d3d8f9adf730efde2ea677744354301bd17fce43..8a0f0ed8c99ee3bb0c7b08df072d5788d9ba36de 100644 --- a/plugins/CoreAdminHome/API.php +++ b/plugins/CoreAdminHome/API.php @@ -39,12 +39,6 @@ class API extends \Piwik\Plugin\API return TaskScheduler::runTasks(); } - public function getKnownSegmentsToArchive() - { - Piwik::checkUserHasSuperUserAccess(); - return SettingsPiwik::getKnownSegmentsToArchive(); - } - /* * stores the list of websites IDs to re-reprocess in archive.php */