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

Laminas migration M 2.4.0 #606

Merged
merged 32 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a53ae5c
#AC-7583::Stores->Configuration page errors when enabled Fastly- upda…
glo05363 Jan 12, 2023
8e0e9cf
#AC-7583::Stores->Configuration page errors when enabled Fastly- fixe…
glo05363 Jan 13, 2023
8d88f6f
Notification class refactored
dpotkoc Jan 16, 2023
4b3ac68
Merge branch 'master' of github.com:fastly/fastly-magento2 into lamin…
bbutkovic Jan 16, 2023
879e451
Api.php laminas
dpotkoc Jan 16, 2023
77b2ee9
wp
dpotkoc Jan 16, 2023
b51947e
Merge branch 'laminas-migration' of github.com:favicode/fastly-magent…
dpotkoc Jan 16, 2023
6c43e10
wp
dpotkoc Jan 16, 2023
68dd0f2
wp
dpotkoc Jan 16, 2023
63360b5
wp
dpotkoc Jan 16, 2023
99054f2
wp
dpotkoc Jan 16, 2023
714d710
wp
dpotkoc Jan 16, 2023
5dec1cd
update Magento, PHP and Laminas dependencies
bbutkovic Jan 16, 2023
1a0975c
Observer/InvalidateVarnishObserver.php
dpotkoc Jan 17, 2023
de7a183
Merge branch 'laminas-migration' of github.com:favicode/fastly-magent…
dpotkoc Jan 17, 2023
0a5b692
deprecate 2.3.x
bbutkovic Jan 17, 2023
a05109b
Observer/FlushAllCacheObserver.php
dpotkoc Jan 17, 2023
5d629ba
Merge branch 'laminas-migration' of github.com:favicode/fastly-magent…
dpotkoc Jan 17, 2023
258f6b9
deprecate 2.3.x
bbutkovic Jan 17, 2023
395f17a
Model/PurgeCache.php
dpotkoc Jan 17, 2023
9639dae
Layout/LayoutPlugin.php
dpotkoc Jan 17, 2023
69198c2
Layout/LayoutPlugin.php
dpotkoc Jan 17, 2023
f6ec191
Model/Config/ConfigRewrite.php
dpotkoc Jan 17, 2023
23467af
Controller/Adminhtml/FastlyCdn/Purge/Quick.php
dpotkoc Jan 17, 2023
410cd91
Controller/Adminhtml/FastlyCdn/Purge/All.php
dpotkoc Jan 17, 2023
abc988a
Api.php
dpotkoc Jan 18, 2023
ce016da
Model/Statistic.php
dpotkoc Jan 18, 2023
c6789f0
Model/Statistic.php
dpotkoc Jan 18, 2023
9d77a41
Model/Api.php
dpotkoc Jan 18, 2023
bc18396
Model/Api.php
dpotkoc Jan 19, 2023
058d5b1
api.php
dpotkoc Jan 19, 2023
406b1fe
Merge branch 'master' into laminas-migration
dpotkoc Jan 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Controller/Adminhtml/FastlyCdn/Purge/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @copyright Copyright (c) 2016 Fastly, Inc. (http://www.fastly.com)
* @license BSD, see LICENSE_FASTLY_CDN.txt
*/

namespace Fastly\Cdn\Controller\Adminhtml\FastlyCdn\Purge;

use Fastly\Cdn\Model\Api;
Expand All @@ -26,9 +27,7 @@
use Magento\Framework\App\Cache\Manager;

/**
* Class All
*
* @package Fastly\Cdn\Controller\Adminhtml\FastlyCdn\Purge
* Class Purge All objects
*/
class All extends Action
{
Expand All @@ -50,7 +49,7 @@ class All extends Action
*/
public function __construct(
Context $context,
Api $api,
Api $api,
Manager $cacheManager
) {
$this->api = $api;
Expand All @@ -61,10 +60,10 @@ public function __construct(

/**
* Performs cache cleanup and purge all on Fastly service.
*
* Should be used when "Preserve static assets on purge" is enabled.
*
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface
* @throws \Zend_Uri_Exception
*/
public function execute()
{
Expand Down
20 changes: 9 additions & 11 deletions Controller/Adminhtml/FastlyCdn/Purge/Quick.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@

use Fastly\Cdn\Model\Config;
use Fastly\Cdn\Model\PurgeCache;
use Laminas\Uri\UriFactory;
use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\UrlInterface;
use Magento\Store\Model\StoreManagerInterface;

/**
* Class Quick
*
* @package Fastly\Cdn\Controller\Adminhtml\FastlyCdn\Purge
* Class Quick purge
*/
class Quick extends Action
{
Expand Down Expand Up @@ -82,10 +81,10 @@ public function execute()
// check if url is given
$url = $this->getRequest()->getParam('quick_purge_url', false);

$zendUri = \Zend_Uri::factory($url);
$host = $zendUri->getHost();
$scheme = $zendUri->getScheme();
$path = $zendUri->getPath();
$laminasUri = UriFactory::factory($url);
$host = $laminasUri->getHost();
$scheme = $laminasUri->getScheme();
$path = $laminasUri->getPath();

// check if host is one of magento's
if (!$this->isHostInDomainList($host)) {
Expand Down Expand Up @@ -120,11 +119,10 @@ public function execute()
/**
* Checks if host is one of Magento's configured domains.
*
* @param $host
* @param string $host
* @return bool
* @throws \Zend_Uri_Exception
*/
private function isHostInDomainList($host)
private function isHostInDomainList($host): bool
{
$urlTypes = [
UrlInterface::URL_TYPE_LINK,
Expand All @@ -139,7 +137,7 @@ private function isHostInDomainList($host)
/** @var \Magento\Store\Model\Store $store */
foreach ($urlTypes as $urlType) {
foreach ($secureScheme as $scheme) {
$shopHost = \Zend_Uri::factory($store->getBaseUrl($urlType, $scheme))->getHost();
$shopHost = UriFactory::factory($store->getBaseUrl($urlType, $scheme))->getHost();
if ($host === $shopHost) {
return true;
}
Expand Down
Loading