Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix archiving when getmypid is disabled #15330

Merged
merged 3 commits into from Dec 31, 2019
Merged

Fix archiving when getmypid is disabled #15330

merged 3 commits into from Dec 31, 2019

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Dec 31, 2019

See matomo-org/matomo-for-wordpress#163 (comment)

Seems this fixes some PHP bug or so. More explanation in above link

@tsteur tsteur added the Needs Review PRs that need a code review label Dec 31, 2019
@tsteur tsteur added this to the 3.13.1 milestone Dec 31, 2019
@@ -130,7 +132,11 @@ private function buildRememberArchivedReportIdForSiteAndDate($idSite, $date)
private function buildRememberArchivedReportIdProcessSafe($idSite, $date)
{
$id = $this->buildRememberArchivedReportIdForSiteAndDate($idSite, $date);
$id .= '_' . getmypid();
if (Process::isMethodDisabled('getmypid')) {
$id .= '_' . Common::getRandomString();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we cache the value of Common::getRandomString() so the same value gets used next time (to simulate a real PID)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diosmosis this method should be executed max once per request as the next time the option is set... could even always use getRandomInt in theory

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, makes sense 👍 will merge

@diosmosis diosmosis merged commit 0f88558 into 3.x-dev Dec 31, 2019
@diosmosis diosmosis deleted the archivegetmypid branch December 31, 2019 21:30
jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 22, 2020
* Fix archiving when getmypid is disabled

* Update ArchiveInvalidator.php

* Update ArchiveInvalidator.php
jbuget pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 26, 2020
* Fix archiving when getmypid is disabled

* Update ArchiveInvalidator.php

* Update ArchiveInvalidator.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants