installed plugin Infinite Uploads
version 2.0.8
This commit is contained in:
44
wp-content/plugins/infinite-uploads/vendor/Aws3/Aws/Retry/Configuration.php
vendored
Normal file
44
wp-content/plugins/infinite-uploads/vendor/Aws3/Aws/Retry/Configuration.php
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace UglyRobot\Infinite_Uploads\Aws\Retry;
|
||||
|
||||
use UglyRobot\Infinite_Uploads\Aws\Retry\Exception\ConfigurationException;
|
||||
class Configuration implements \UglyRobot\Infinite_Uploads\Aws\Retry\ConfigurationInterface
|
||||
{
|
||||
private $mode;
|
||||
private $maxAttempts;
|
||||
private $validModes = ['legacy', 'standard', 'adaptive'];
|
||||
public function __construct($mode = 'legacy', $maxAttempts = 3)
|
||||
{
|
||||
$mode = strtolower($mode);
|
||||
if (!in_array($mode, $this->validModes)) {
|
||||
throw new \UglyRobot\Infinite_Uploads\Aws\Retry\Exception\ConfigurationException("'{$mode}' is not a valid mode." . " The mode has to be 'legacy', 'standard', or 'adaptive'.");
|
||||
}
|
||||
if (!is_numeric($maxAttempts) || intval($maxAttempts) != $maxAttempts || $maxAttempts < 1) {
|
||||
throw new \UglyRobot\Infinite_Uploads\Aws\Retry\Exception\ConfigurationException("The 'maxAttempts' parameter has" . " to be an integer >= 1.");
|
||||
}
|
||||
$this->mode = $mode;
|
||||
$this->maxAttempts = intval($maxAttempts);
|
||||
}
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getMode()
|
||||
{
|
||||
return $this->mode;
|
||||
}
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getMaxAttempts()
|
||||
{
|
||||
return $this->maxAttempts;
|
||||
}
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
return ['mode' => $this->getMode(), 'max_attempts' => $this->getMaxAttempts()];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user