Skip to content

Commit f27a0fb

Browse files
committed
Remove no longer used climulti request parser
1 parent 2df67a9 commit f27a0fb

File tree

5 files changed

+5
-318
lines changed

5 files changed

+5
-318
lines changed

core/CliMulti/RequestParser.php

Lines changed: 0 additions & 113 deletions
This file was deleted.

core/CronArchive.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Piwik\CronArchive\FixedSiteIds;
2020
use Piwik\CronArchive\Performance\Logger;
2121
use Piwik\Archive\ArchiveInvalidator;
22-
use Piwik\CliMulti\RequestParser;
2322
use Piwik\CronArchive\QueueConsumer;
2423
use Piwik\CronArchive\SharedSiteIds;
2524
use Piwik\CronArchive\StopArchiverException;
@@ -221,11 +220,6 @@ class CronArchive
221220
*/
222221
private $archiveFilter;
223222

224-
/**
225-
* @var RequestParser
226-
*/
227-
private $cliMultiRequestParser;
228-
229223
/**
230224
* @var bool|mixed
231225
*/
@@ -250,7 +244,6 @@ public function __construct(LoggerInterface $logger = null)
250244
$this->periodIdsToLabels = array_flip(Piwik::$idPeriods);
251245

252246
$this->supportsAsync = $this->makeCliMulti()->supportsAsync();
253-
$this->cliMultiRequestParser = new RequestParser($this->supportsAsync);
254247

255248
$this->archiveFilter = new ArchiveFilter();
256249
}
@@ -380,7 +373,6 @@ public function run()
380373
$this->model,
381374
$this->segmentArchiving,
382375
$this,
383-
$this->cliMultiRequestParser,
384376
$this->archiveFilter
385377
);
386378

core/CronArchive/QueueConsumer.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Piwik\ArchiveProcessor\Loader;
1313
use Piwik\ArchiveProcessor\Parameters;
1414
use Piwik\ArchiveProcessor\Rules;
15-
use Piwik\CliMulti\RequestParser;
1615
use Piwik\CronArchive;
1716
use Piwik\DataAccess\ArchiveSelector;
1817
use Piwik\DataAccess\Model;
@@ -78,11 +77,6 @@ class QueueConsumer
7877
*/
7978
private $periodIdsToLabels;
8079

81-
/**
82-
* @var RequestParser
83-
*/
84-
private $cliMultiRequestParser;
85-
8680
/**
8781
* @var int
8882
*/
@@ -118,7 +112,6 @@ public function __construct(
118112
Model $model,
119113
SegmentArchiving $segmentArchiving,
120114
CronArchive $cronArchive,
121-
RequestParser $cliMultiRequestParser,
122115
ArchiveFilter $archiveFilter = null
123116
) {
124117
$this->logger = $logger;
@@ -128,7 +121,6 @@ public function __construct(
128121
$this->model = $model;
129122
$this->segmentArchiving = $segmentArchiving;
130123
$this->cronArchive = $cronArchive;
131-
$this->cliMultiRequestParser = $cliMultiRequestParser;
132124
$this->archiveFilter = $archiveFilter;
133125

134126
// if we skip or can't process an idarchive, we want to ignore it the next time we look for an invalidated

tests/PHPUnit/Integration/CronArchive/QueueConsumerTest.php

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
namespace Piwik\Tests\Integration\CronArchive;
1111

1212
use Piwik\ArchiveProcessor\Rules;
13-
use Piwik\CliMulti\RequestParser;
1413
use Piwik\Common;
1514
use Piwik\Config;
1615
use Piwik\Period\Day;
@@ -67,7 +66,6 @@ public function testConsumerIgnoresPeriodsThatHaveBeenDisabledInApi()
6766
new Model(),
6867
new SegmentArchiving(),
6968
$cronArchive,
70-
new RequestParser(true),
7169
$archiveFilter
7270
);
7371

@@ -166,13 +164,12 @@ public function testInvalidateConsumeOrder()
166164

167165
$queueConsumer = new QueueConsumer(
168166
StaticContainer::get(LoggerInterface::class),
169-
new FixedSiteIds([1,2,3]),
167+
new FixedSiteIds([1, 2, 3]),
170168
3,
171169
24,
172170
new Model(),
173171
new SegmentArchiving(),
174172
$cronArchive,
175-
new RequestParser(true),
176173
$archiveFilter
177174
);
178175

@@ -354,13 +351,12 @@ public function testInvalidateConsumeOrder()
354351

355352
$queueConsumer = new QueueConsumer(
356353
StaticContainer::get(LoggerInterface::class),
357-
new FixedSiteIds([1,2,3]),
354+
new FixedSiteIds([1, 2, 3]),
358355
3,
359356
24,
360357
new Model(),
361358
new SegmentArchiving(),
362359
$cronArchive,
363-
new RequestParser(true),
364360
$archiveFilter
365361
);
366362

@@ -482,7 +478,6 @@ public function testPluginInvalidationDeletedIfUsableArchiveExists()
482478
new Model(),
483479
new SegmentArchiving(),
484480
$cronArchive,
485-
new RequestParser(true),
486481
$archiveFilter
487482
);
488483

@@ -563,7 +558,6 @@ public function testSkipSegmentsToday()
563558
new Model(),
564559
new SegmentArchiving(),
565560
$cronArchive,
566-
new RequestParser(true),
567561
$archiveFilter
568562
);
569563

@@ -679,7 +673,6 @@ public function testMaxWebsitesToProcess()
679673
new Model(),
680674
new SegmentArchiving(),
681675
$cronArchive,
682-
new RequestParser(true),
683676
$archiveFilter
684677
);
685678
$this->assertNull($queueConsumer->setMaxSitesToProcess());
@@ -822,7 +815,6 @@ public function testCanSkipArchiveBecauseNoPointReturnsTrueIfDateRangeHasNoVisit
822815
new Model(),
823816
new SegmentArchiving(),
824817
$cronArchive,
825-
new RequestParser(true),
826818
$archiveFilter
827819
);
828820

@@ -851,7 +843,6 @@ public function testCanSkipArchiveBecauseNoPointReturnsFalseIfDateRangeHasVisits
851843
new Model(),
852844
new SegmentArchiving(),
853845
new CronArchive(),
854-
new RequestParser(true),
855846
$this->makeTestArchiveFilter()
856847
);
857848

@@ -880,7 +871,6 @@ public function testUsableArchiveExistsReturnsTrueIfDateRangeHasVisitsAndPeriodI
880871
new Model(),
881872
new SegmentArchiving(),
882873
new CronArchive(),
883-
new RequestParser(true),
884874
$this->makeTestArchiveFilter()
885875
);
886876

@@ -916,7 +906,6 @@ public function testUsableArchiveExistsReturnsTrueIfDateRangeHasVisitsAndPeriodI
916906
new Model(),
917907
new SegmentArchiving(),
918908
new CronArchive(),
919-
new RequestParser(true),
920909
$this->makeTestArchiveFilter()
921910
);
922911

@@ -955,7 +944,6 @@ public function testCanSkipArchiveBecauseNoPointReturnsFalseIfDateRangeHasVisits
955944
new Model(),
956945
new SegmentArchiving(),
957946
new CronArchive(),
958-
new RequestParser(true),
959947
$this->makeTestArchiveFilter()
960948
);
961949

@@ -991,7 +979,6 @@ public function testCanSkipArchiveBecauseNoPointReturnsTrueSegmentArchivingForPl
991979
new Model(),
992980
new SegmentArchiving(),
993981
new CronArchive(),
994-
new RequestParser(true),
995982
$this->makeTestArchiveFilter()
996983
);
997984

@@ -1115,10 +1102,9 @@ public function testShouldSkipArchiveBecauseLowerPeriodOrSegmentIsInProgress($ex
11151102
Rules::setBrowserTriggerArchiving(true);
11161103

11171104
$this->insertInvalidations($existingInvalidations);
1118-
$cliRequestProcessor = $this->getMockRequestParser([]);
11191105

11201106
/** @var QueueConsumer $queueConsumer */
1121-
$queueConsumer = $this->getQueueConsumerWithMocks($cliRequestProcessor);
1107+
$queueConsumer = $this->getQueueConsumerWithMocks();
11221108

11231109
$periods = array_flip(Piwik::$idPeriods);
11241110

@@ -1394,23 +1380,13 @@ private function getMockCronArchive()
13941380
->getMock();
13951381
}
13961382

1397-
private function getMockRequestParser($cliMultiProcesses)
1398-
{
1399-
$mock = $this->getMockBuilder(RequestParser::class)
1400-
->disableOriginalConstructor()
1401-
->onlyMethods(['getInProgressArchivingCommands'])
1402-
->getMock();
1403-
$mock->method('getInProgressArchivingCommands')->willReturn($cliMultiProcesses);
1404-
return $mock;
1405-
}
1406-
1407-
private function getQueueConsumerWithMocks($cliRequestProcessor)
1383+
private function getQueueConsumerWithMocks()
14081384
{
14091385
$mockCronArchive = $this->getMockBuilder(CronArchive::class)
14101386
->disableOriginalConstructor()
14111387
->getMock();
14121388

1413-
return new QueueConsumer(new NullLogger(), null, null, null, new Model(), new SegmentArchiving(), $mockCronArchive, $cliRequestProcessor);
1389+
return new QueueConsumer(new NullLogger(), null, null, null, new Model(), new SegmentArchiving(), $mockCronArchive);
14141390
}
14151391

14161392
protected static function configureFixture($fixture)

0 commit comments

Comments
 (0)