You are here

class PresignedPath in AmazonS3 7.2

@class PresignedPath @package Drupal\amazons3

Hierarchy

Expanded class hierarchy of PresignedPath

4 files declare their use of PresignedPath
PresignedPathTest.php in tests/Matchable/PresignedPathTest.php
StreamWrapper.php in src/StreamWrapper.php
Drupal stream wrapper implementation for Amazon S3
StreamWrapperConfiguration.php in src/StreamWrapperConfiguration.php
StreamWrapperTest.php in tests/StreamWrapperTest.php

File

src/Matchable/PresignedPath.php, line 9

Namespace

Drupal\amazons3\Matchable
View source
class PresignedPath extends BasicPath {

  /**
   * The timeout for URLs generated from this presigned path.
   *
   * @var int
   */
  protected $timeout;

  /**
   * Create an array of PresignedPaths.
   *
   * @param array $patterns
   *   An array of patterns. Each key is a regular expression, and each value is
   *   an integer of the presigned timeout in seconds.
   *
   * @return PresignedPath[]
   */
  public static function factory(array $patterns) {
    $presignedPaths = array();
    foreach ($patterns as $pattern => $timeout) {
      $presignedPaths[] = new static($pattern, $timeout);
    }
    return $presignedPaths;
  }

  /**
   * @param string $pattern
   * @param int $timeout
   */
  public function __construct($pattern, $timeout) {
    $this->pattern = $pattern;
    $this->timeout = $timeout;
  }

  /**
   * @return string
   */
  public function getPath() {
    return $this->pattern;
  }

  /**
   * @return int
   */
  public function getTimeout() {
    return $this->timeout;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BasicPath::$pattern protected property The path pattern for this presigned path configuration.
BasicPath::__toString function Overrides MatchableRegex::__toString
MatchableRegex::match public function
PresignedPath::$timeout protected property The timeout for URLs generated from this presigned path.
PresignedPath::factory public static function Create an array of PresignedPaths. Overrides BasicPath::factory
PresignedPath::getPath public function Overrides BasicPath::getPath
PresignedPath::getTimeout public function
PresignedPath::__construct public function Overrides BasicPath::__construct