-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.4-develop' into cache-clean-remove
- Loading branch information
Showing
150 changed files
with
2,324 additions
and
480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\AwsS3\Model; | ||
|
||
use Aws\Handler\GuzzleV6\GuzzleHandler; | ||
use GuzzleHttp\Client; | ||
use GuzzleHttp\HandlerStack; | ||
use GuzzleHttp\MessageFormatter; | ||
use GuzzleHttp\Middleware; | ||
use Magento\Framework\App\Filesystem\DirectoryList; | ||
use Magento\Framework\Exception\FileSystemException; | ||
use Magento\Framework\Filesystem; | ||
use Monolog\Handler\StreamHandler; | ||
use Monolog\Logger; | ||
|
||
final class HttpLoggerHandler | ||
{ | ||
/** | ||
* @var Filesystem\Directory\WriteInterface | ||
*/ | ||
private $directory; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $file; | ||
|
||
/** | ||
* @param Filesystem $filesystem | ||
* @param string $file | ||
* @throws FileSystemException | ||
*/ | ||
public function __construct( | ||
Filesystem $filesystem, | ||
$file = 'debug/s3.log' | ||
) { | ||
$this->directory = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR); | ||
$this->file = $file; | ||
} | ||
|
||
public function __invoke() | ||
{ | ||
$this->directory->create(pathinfo($this->file, PATHINFO_DIRNAME)); | ||
$localStream = $this->directory->getDriver()->fileOpen($this->directory->getAbsolutePath($this->file), 'a'); | ||
$streamHandler = new StreamHandler($localStream, Logger::DEBUG, true, null, true); | ||
$logger = new \Monolog\Logger('S3', [$streamHandler]); | ||
$stack = HandlerStack::create(); | ||
$stack->push( | ||
Middleware::log( | ||
$logger, | ||
new MessageFormatter('{code}:{method}:{target} {error}') | ||
) | ||
); | ||
return new GuzzleHandler(new Client(['handler' => $stack])); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
.../Catalog/Test/Mftf/ActionGroup/AssertStorefrontCustomOptionCheckboxByPriceActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AssertStorefrontCustomOptionCheckboxByPriceActionGroup"> | ||
<annotations> | ||
<description>Validates that the provided price for Custom Option Checkbox is present on the Storefront Product page.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="optionTitle" type="string" defaultValue="{{ProductOptionCheckbox.title}}"/> | ||
<argument name="price" type="string" defaultValue="10"/> | ||
</arguments> | ||
|
||
<seeElement selector="{{StorefrontProductInfoMainSection.productAttributeOptionsCheckbox(optionTitle, price)}}" stepKey="checkPriceProductOptionCheckbox"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.