diff options
19 files changed, 46 insertions, 47 deletions
diff --git a/core/Archive.php b/core/Archive.php index d8032ce7e6..c95a37ddd3 100644 --- a/core/Archive.php +++ b/core/Archive.php @@ -10,7 +10,7 @@ namespace Piwik; use Piwik\Archive\Parameters; use Piwik\ArchiveProcessor\Rules; -use Piwik\Archive\Invalidator; +use Piwik\Archive\ArchiveInvalidator; use Piwik\DataAccess\ArchiveSelector; use Piwik\Period\Factory as PeriodFactory; @@ -517,7 +517,7 @@ class Archive return; // all requested site ids were already handled } - $invalidator = new Invalidator(); + $invalidator = new ArchiveInvalidator(); $sitesPerDays = $invalidator->getRememberedArchivedReportsThatShouldBeInvalidated(); foreach ($sitesPerDays as $date => $siteIds) { diff --git a/core/Archive/Invalidator.php b/core/Archive/ArchiveInvalidator.php index bdb4dd9bf6..e9ce777cc4 100644 --- a/core/Archive/Invalidator.php +++ b/core/Archive/ArchiveInvalidator.php @@ -45,7 +45,7 @@ use Piwik\Site; * Later, during Piwik's normal execution, the list will be read and every archive it references will * be invalidated. */ -class Invalidator +class ArchiveInvalidator { private $warningDates = array(); private $processedDates = array(); diff --git a/core/Archive/Purger.php b/core/Archive/ArchivePurger.php index 031decc36d..e41ce375c5 100644 --- a/core/Archive/Purger.php +++ b/core/Archive/ArchivePurger.php @@ -16,7 +16,6 @@ use Piwik\Date; use Piwik\Db; use Piwik\Log; use Piwik\Piwik; -use Piwik\Plugins\CoreAdminHome\Tasks\ArchivesToPurgeDistributedList; /** * Service that purges temporary, error-ed, invalid and custom range archives from archive tables. @@ -27,9 +26,9 @@ use Piwik\Plugins\CoreAdminHome\Tasks\ArchivesToPurgeDistributedList; * Error-ed archives are purged w/o constraint. * * Invalid archives are purged if a new, valid, archive exists w/ the same site, date, period combination. - * Archives are marked as invalid via Piwik\Archive\Invalidator. + * Archives are marked as invalid via Piwik\Archive\ArchiveInvalidator. */ -class Purger +class ArchivePurger { /** * @var Model diff --git a/core/CronArchive.php b/core/CronArchive.php index 12991dab72..0ff2ee8242 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -12,7 +12,7 @@ use Exception; use Piwik\ArchiveProcessor\Rules; use Piwik\CronArchive\FixedSiteIds; use Piwik\CronArchive\SharedSiteIds; -use Piwik\Archive\Invalidator; +use Piwik\Archive\ArchiveInvalidator; use Piwik\Exception\UnexpectedWebsiteFoundException; use Piwik\Metrics\Formatter; use Piwik\Period\Factory as PeriodFactory; @@ -973,7 +973,7 @@ class CronArchive public function invalidateArchivedReportsForSitesThatNeedToBeArchivedAgain() { - $invalidator = new Invalidator(); + $invalidator = new ArchiveInvalidator(); $sitesPerDays = $invalidator->getRememberedArchivedReportsThatShouldBeInvalidated(); foreach ($sitesPerDays as $date => $siteIds) { diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php index 3a149cfbd0..f672cd96da 100644 --- a/core/Tracker/Visit.php +++ b/core/Tracker/Visit.php @@ -11,7 +11,7 @@ namespace Piwik\Tracker; use Piwik\Common; use Piwik\Config; -use Piwik\Archive\Invalidator; +use Piwik\Archive\ArchiveInvalidator; use Piwik\Date; use Piwik\Exception\UnexpectedWebsiteFoundException; use Piwik\Network\IPUtils; @@ -682,7 +682,7 @@ class Visit implements VisitInterface $date = Date::factory((int) $time, $timezone); if (!$date->isToday()) { // we don't have to handle in case date is in future as it is not allowed by tracker - $invalidReport = new Invalidator(); + $invalidReport = new ArchiveInvalidator(); $invalidReport->rememberToInvalidateArchivedReportsLater($idSite, $date); } } diff --git a/plugins/CoreAdminHome/API.php b/plugins/CoreAdminHome/API.php index d3041a170d..6329fc8993 100644 --- a/plugins/CoreAdminHome/API.php +++ b/plugins/CoreAdminHome/API.php @@ -10,7 +10,7 @@ namespace Piwik\Plugins\CoreAdminHome; use Exception; use Piwik\Container\StaticContainer; -use Piwik\Archive\Invalidator; +use Piwik\Archive\ArchiveInvalidator; use Piwik\Db; use Piwik\Piwik; use Piwik\Scheduler\Scheduler; @@ -69,7 +69,7 @@ class API extends \Piwik\Plugin\API Piwik::checkUserHasAdminAccess($idSites); - $invalidator = new Invalidator(); + $invalidator = new ArchiveInvalidator(); $output = $invalidator->markArchivesAsInvalidated($idSites, $dates, $period); Site::clearCache(); diff --git a/plugins/CoreAdminHome/Commands/FixDuplicateLogActions.php b/plugins/CoreAdminHome/Commands/FixDuplicateLogActions.php index b26b866e27..be9c74a152 100644 --- a/plugins/CoreAdminHome/Commands/FixDuplicateLogActions.php +++ b/plugins/CoreAdminHome/Commands/FixDuplicateLogActions.php @@ -11,7 +11,7 @@ namespace Piwik\Plugins\CoreAdminHome\Commands; use Piwik\Common; use Piwik\Container\StaticContainer; use Piwik\DataAccess\Actions; -use Piwik\Archive\Invalidator; +use Piwik\Archive\ArchiveInvalidator; use Piwik\Plugin\ConsoleCommand; use Piwik\Plugins\CoreAdminHome\Model\DuplicateActionRemover; use Piwik\Timer; @@ -39,7 +39,7 @@ class FixDuplicateLogActions extends ConsoleCommand /** * Used to invalidate archives. Only used if $shouldInvalidateArchives is true. * - * @var Invalidator + * @var ArchiveInvalidator */ private $archiveInvalidator; @@ -65,17 +65,17 @@ class FixDuplicateLogActions extends ConsoleCommand /** * Constructor. * - * @param Invalidator $invalidator + * @param ArchiveInvalidator $invalidator * @param DuplicateActionRemover $duplicateActionRemover * @param Actions $actionsAccess * @param LoggerInterface $logger */ - public function __construct(Invalidator $invalidator = null, DuplicateActionRemover $duplicateActionRemover = null, + public function __construct(ArchiveInvalidator $invalidator = null, DuplicateActionRemover $duplicateActionRemover = null, Actions $actionsAccess = null, LoggerInterface $logger = null) { parent::__construct(); - $this->archiveInvalidator = $invalidator ?: new Invalidator(); + $this->archiveInvalidator = $invalidator ?: new ArchiveInvalidator(); $this->duplicateActionRemover = $duplicateActionRemover ?: new DuplicateActionRemover(); $this->actionsAccess = $actionsAccess ?: new Actions(); $this->logger = $logger ?: StaticContainer::get('Psr\Log\LoggerInterface'); diff --git a/plugins/CoreAdminHome/Commands/PurgeOldArchiveData.php b/plugins/CoreAdminHome/Commands/PurgeOldArchiveData.php index 8c88a7e312..dcea37f021 100644 --- a/plugins/CoreAdminHome/Commands/PurgeOldArchiveData.php +++ b/plugins/CoreAdminHome/Commands/PurgeOldArchiveData.php @@ -9,7 +9,7 @@ namespace Piwik\Plugins\CoreAdminHome\Commands; use Piwik\Archive; -use Piwik\Archive\Purger; +use Piwik\Archive\ArchivePurger; use Piwik\DataAccess\ArchiveTableCreator; use Piwik\Date; use Piwik\Db; @@ -29,7 +29,7 @@ class PurgeOldArchiveData extends ConsoleCommand const ALL_DATES_STRING = 'all'; /** - * @var Purger + * @var ArchivePurger */ private $archivePurger; @@ -40,11 +40,11 @@ class PurgeOldArchiveData extends ConsoleCommand */ public static $todayOverride = null; - public function __construct(Purger $archivePurger = null) + public function __construct(ArchivePurger $archivePurger = null) { parent::__construct(); - $this->archivePurger = $archivePurger ?: new Purger(); + $this->archivePurger = $archivePurger ?: new ArchivePurger(); } protected function configure() diff --git a/plugins/CoreAdminHome/Tasks.php b/plugins/CoreAdminHome/Tasks.php index 22a2fbb1a6..b6856f5ef8 100644 --- a/plugins/CoreAdminHome/Tasks.php +++ b/plugins/CoreAdminHome/Tasks.php @@ -9,7 +9,7 @@ namespace Piwik\Plugins\CoreAdminHome; use Piwik\ArchiveProcessor\Rules; -use Piwik\Archive\Purger; +use Piwik\Archive\ArchivePurger; use Piwik\DataAccess\ArchiveTableCreator; use Piwik\Date; use Piwik\Db; @@ -20,13 +20,13 @@ use Piwik\SettingsServer; class Tasks extends \Piwik\Plugin\Tasks { /** - * @var Purger + * @var ArchivePurger */ private $archivePurger; - public function __construct(Purger $archivePurger = null) + public function __construct(ArchivePurger $archivePurger = null) { - $this->archivePurger = $archivePurger ?: new Purger(); + $this->archivePurger = $archivePurger ?: new ArchivePurger(); } public function schedule() diff --git a/plugins/CoreAdminHome/tests/Integration/Commands/PurgeOldArchiveDataTest.php b/plugins/CoreAdminHome/tests/Integration/Commands/PurgeOldArchiveDataTest.php index 1930b414da..5728c6de74 100644 --- a/plugins/CoreAdminHome/tests/Integration/Commands/PurgeOldArchiveDataTest.php +++ b/plugins/CoreAdminHome/tests/Integration/Commands/PurgeOldArchiveDataTest.php @@ -7,7 +7,7 @@ */ namespace Piwik\Plugins\CoreAdminHome\tests\Integration\Commands; -use Piwik\Archive\Purger; +use Piwik\Archive\ArchivePurger; use Piwik\Console; use Piwik\Date; use Piwik\Plugins\CoreAdminHome\Commands\PurgeOldArchiveData; @@ -41,7 +41,7 @@ class PurgeOldArchiveDataTest extends IntegrationTestCase PurgeOldArchiveData::$todayOverride = Date::factory('2015-02-27'); - $archivePurger = new Purger(); + $archivePurger = new ArchivePurger(); $archivePurger->setTodayDate(Date::factory('2015-02-27')); $archivePurger->setYesterdayDate(Date::factory('2015-02-26')); $archivePurger->setNow(Date::factory('2015-02-27 08:00:00')->getTimestamp()); diff --git a/plugins/CoreAdminHome/tests/Integration/TasksTest.php b/plugins/CoreAdminHome/tests/Integration/TasksTest.php index ffb551a464..da3800e9c1 100644 --- a/plugins/CoreAdminHome/tests/Integration/TasksTest.php +++ b/plugins/CoreAdminHome/tests/Integration/TasksTest.php @@ -7,7 +7,7 @@ */ namespace Piwik\Plugins\CoreAdminHome\tests\Integration; -use Piwik\Archive\Purger; +use Piwik\Archive\ArchivePurger; use Piwik\Date; use Piwik\Plugins\CoreAdminHome\Tasks; use Piwik\Plugins\CoreAdminHome\Tasks\ArchivesToPurgeDistributedList; @@ -46,7 +46,7 @@ class TasksTest extends IntegrationTestCase $this->january = Date::factory('2015-01-01'); $this->february = Date::factory('2015-02-01'); - $archivePurger = new Purger(); + $archivePurger = new ArchivePurger(); $archivePurger->setTodayDate(Date::factory('2015-02-27')); $archivePurger->setYesterdayDate(Date::factory('2015-02-26')); $archivePurger->setNow(Date::factory('2015-02-27 08:00:00')->getTimestamp()); diff --git a/plugins/SitesManager/SitesManager.php b/plugins/SitesManager/SitesManager.php index d88c2e7c41..ca47a50540 100644 --- a/plugins/SitesManager/SitesManager.php +++ b/plugins/SitesManager/SitesManager.php @@ -7,7 +7,7 @@ * */ namespace Piwik\Plugins\SitesManager; -use Piwik\Archive\Invalidator; +use Piwik\Archive\ArchiveInvalidator; use Piwik\Tracker\Cache; /** @@ -38,7 +38,7 @@ class SitesManager extends \Piwik\Plugin // we do not delete logs here on purpose (you can run these queries on the log_ tables to delete all data) Cache::deleteCacheWebsiteAttributes($idSite); - $archiveInvalidator = new Invalidator(); + $archiveInvalidator = new ArchiveInvalidator(); $archiveInvalidator->forgetRememberedArchivedReportsToInvalidateForSite($idSite); } diff --git a/plugins/SitesManager/tests/Integration/SitesManagerTest.php b/plugins/SitesManager/tests/Integration/SitesManagerTest.php index 9fc69fdfde..1ba60ce972 100644 --- a/plugins/SitesManager/tests/Integration/SitesManagerTest.php +++ b/plugins/SitesManager/tests/Integration/SitesManagerTest.php @@ -10,7 +10,7 @@ namespace Piwik\Plugins\SitesManager\tests\Integration; use Piwik\Access; use Piwik\Cache; -use Piwik\Archive\Invalidator; +use Piwik\Archive\ArchiveInvalidator; use Piwik\Date; use Piwik\Plugins\SitesManager\SitesManager; use Piwik\Tests\Framework\Fixture; @@ -56,7 +56,7 @@ class SitesManagerTest extends IntegrationTestCase public function test_onSiteDeleted_shouldRemoveRememberedArchiveReports() { - $archive = new Invalidator(); + $archive = new ArchiveInvalidator(); $archive->rememberToInvalidateArchivedReportsLater($this->siteId, Date::factory('2014-04-05')); $archive->rememberToInvalidateArchivedReportsLater($this->siteId, Date::factory('2014-04-06')); $archive->rememberToInvalidateArchivedReportsLater(4949, Date::factory('2014-04-05')); diff --git a/tests/PHPUnit/Integration/Archive/PurgerTest.php b/tests/PHPUnit/Integration/Archive/PurgerTest.php index 4111a28ca9..ea0cec316e 100644 --- a/tests/PHPUnit/Integration/Archive/PurgerTest.php +++ b/tests/PHPUnit/Integration/Archive/PurgerTest.php @@ -7,7 +7,7 @@ */ namespace Piwik\Tests\Integration\Archive; -use Piwik\Archive\Purger; +use Piwik\Archive\ArchivePurger; use Piwik\Config; use Piwik\Date; use Piwik\Db; @@ -25,7 +25,7 @@ class PurgerTest extends IntegrationTestCase public static $fixture; /** - * @var Purger + * @var ArchivePurger */ private $archivePurger; @@ -46,7 +46,7 @@ class PurgerTest extends IntegrationTestCase $this->january = self::$fixture->january; $this->february = self::$fixture->february; - $this->archivePurger = new Purger(); + $this->archivePurger = new ArchivePurger(); $this->archivePurger->setTodayDate(Date::factory('2015-02-27')); $this->archivePurger->setYesterdayDate(Date::factory('2015-02-26')); $this->archivePurger->setNow(Date::factory('2015-02-27 08:00:00')->getTimestamp()); diff --git a/tests/PHPUnit/Integration/CronArchiveTest.php b/tests/PHPUnit/Integration/CronArchiveTest.php index 9397fe511c..c90e64a846 100644 --- a/tests/PHPUnit/Integration/CronArchiveTest.php +++ b/tests/PHPUnit/Integration/CronArchiveTest.php @@ -9,7 +9,7 @@ namespace Piwik\Tests\Integration; use Piwik\CronArchive; -use Piwik\Archive\Invalidator; +use Piwik\Archive\ArchiveInvalidator; use Piwik\Date; use Piwik\Db; use Piwik\Plugins\CoreAdminHome\tests\Framework\Mock\API; @@ -46,7 +46,7 @@ class CronArchiveTest extends IntegrationTestCase public function test_getColumnNamesFromTable() { - $ar = new Invalidator(); + $ar = new ArchiveInvalidator(); $ar->rememberToInvalidateArchivedReportsLater(1, Date::factory('2014-04-05')); $ar->rememberToInvalidateArchivedReportsLater(2, Date::factory('2014-04-05')); $ar->rememberToInvalidateArchivedReportsLater(2, Date::factory('2014-04-06')); diff --git a/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php b/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php index 24e178b153..7847abc202 100644 --- a/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php +++ b/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php @@ -11,17 +11,17 @@ namespace Piwik\Tests\Integration\DataAccess; use Piwik\Date; use Piwik\Option; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; -use Piwik\Archive\Invalidator; +use Piwik\Archive\ArchiveInvalidator; /** * @group Archiver - * @group Invalidator + * @group ArchiveInvalidator * @group DataAccess */ class ArchiveInvalidatorTest extends IntegrationTestCase { /** - * @var Invalidator + * @var ArchiveInvalidator */ private $invalidator; @@ -29,7 +29,7 @@ class ArchiveInvalidatorTest extends IntegrationTestCase { parent::setUp(); - $this->invalidator = new Invalidator(); + $this->invalidator = new ArchiveInvalidator(); } public function test_rememberToInvalidateArchivedReportsLater_shouldCreateAnEntryInCaseThereIsNoneYet() diff --git a/tests/PHPUnit/Integration/Tracker/VisitTest.php b/tests/PHPUnit/Integration/Tracker/VisitTest.php index ed767b1ea0..919a918516 100644 --- a/tests/PHPUnit/Integration/Tracker/VisitTest.php +++ b/tests/PHPUnit/Integration/Tracker/VisitTest.php @@ -11,7 +11,7 @@ namespace Piwik\Tests\Integration\Tracker; use Piwik\Access; use Piwik\Cache; use Piwik\CacheId; -use Piwik\Archive\Invalidator; +use Piwik\Archive\ArchiveInvalidator; use Piwik\Date; use Piwik\Network\IPUtils; use Piwik\Plugin\Manager; @@ -370,7 +370,7 @@ class VisitTest extends IntegrationTestCase $visit->handle(); - $archive = new Invalidator(); + $archive = new ArchiveInvalidator(); $remembered = $archive->getRememberedArchivedReportsThatShouldBeInvalidated(); $this->assertSame($expectedRemeberedArchivedReports, $remembered); diff --git a/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php b/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php index 3c1509f0c6..7e9a576b71 100755 --- a/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php +++ b/tests/PHPUnit/System/TwoVisitorsTwoWebsitesDifferentDaysConversionsTest.php @@ -9,7 +9,7 @@ namespace Piwik\Tests\System; use Piwik\Archive; use Piwik\Cache; -use Piwik\Archive\Invalidator; +use Piwik\Archive\ArchiveInvalidator; use Piwik\Option; use Piwik\Plugins\Goals\Archiver; use Piwik\Segment; @@ -172,7 +172,7 @@ class TwoVisitorsTwoWebsitesDifferentDaysConversionsTest extends SystemTestCase $this->assertEquals(array(self::$fixture->idSite1, self::$fixture->idSite2), $cache->fetch('Archive.SiteIdsOfRememberedReportsInvalidated')); - $invalidator = new Invalidator(); + $invalidator = new ArchiveInvalidator(); self::$fixture->trackVisits(); diff --git a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php index 4a74c954bc..77bb4f8dac 100755 --- a/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php +++ b/tests/PHPUnit/System/TwoVisitsWithCustomVariablesSegmentMatchVisitorTypeTest.php @@ -8,7 +8,7 @@ namespace Piwik\Tests\System; use Piwik\Common; -use Piwik\Archive\Invalidator; +use Piwik\Archive\ArchiveInvalidator; use Piwik\CronArchive\SitesToReprocessDistributedList; use Piwik\Db; use Piwik\Tests\Framework\TestCase\SystemTestCase; |