-
Notifications
You must be signed in to change notification settings - Fork 4
Extension supports Varnish 5+ #27
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
Conversation
Helper/Data.php
Outdated
$applicationFactory->save(); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add comment block that defines what the function does and what parameters it takes. Follow guide from other public functions.
Controller/Adminhtml/Report/Save.php
Outdated
$proxy_image = $this->helper->getProxyImage($account_id, $application_id); | ||
|
||
/** Extract the generated VCL code appropriate for their version*/ | ||
if (strpos($proxy_image, "4" !== false)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strpos
would capture 5.4.2
or something similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since varnish 4.* needs one vcl file and all the other currently released versions(5.* and 6.*) need the other, I'm stripping off all digits but the major release. Varnish 5.4.2 is hitting this if-block as "varnish:5". Feel free to suggest if you see a better way.
$application_id = $this->state->getApplicationId(); | ||
/** @var string $environment_name */ | ||
$environment_name = $this->state->getEnvironmentName(); | ||
/** @var string $proxy_image*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code block apparently duplicated here and in UpdateVclCommand.php seems like an opportunity to refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Adds logic to deliver the appropriate magento vcl based upon the varnish image of the account making the request. Tested with Varnish 4, 5, and 6 instances alongside other proxies.