Open Journal Systems  3.3.0
Guzzle\Plugin\Md5\Md5ValidatorPlugin Class Reference
Inheritance diagram for Guzzle\Plugin\Md5\Md5ValidatorPlugin:
Symfony\Component\EventDispatcher\EventSubscriberInterface

Public Member Functions

 __construct ($contentEncoded=true, $contentLengthCutoff=false)
 
 onRequestComplete (Event $event)
 

Static Public Member Functions

static getSubscribedEvents ()
 

Protected Attributes

 $contentEncoded
 
 $contentLengthCutoff
 

Detailed Description

Ensures that an the MD5 hash of an entity body matches the Content-MD5 header (if set) of an HTTP response. An exception is thrown if the calculated MD5 does not match the expected MD5.

Definition at line 14 of file Md5ValidatorPlugin.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Plugin\Md5\Md5ValidatorPlugin::__construct (   $contentEncoded = true,
  $contentLengthCutoff = false 
)
Parameters
bool$contentEncodedCalculating the MD5 hash of an entity body where a Content-Encoding was applied is a more expensive comparison because the entity body will need to be compressed in order to get the correct hash. Set to FALSE to not validate the MD5 hash of an entity body with an applied Content-Encoding.
bool | int$contentLengthCutoffMaximum Content-Length (bytes) in which a MD5 hash will be validated. Any response with a Content-Length greater than this value will not be validated because it will be deemed too memory intensive.

Definition at line 37 of file Md5ValidatorPlugin.php.

References Guzzle\Plugin\Md5\Md5ValidatorPlugin\$contentEncoded, and Guzzle\Plugin\Md5\Md5ValidatorPlugin\$contentLengthCutoff.

Member Function Documentation

◆ getSubscribedEvents()

static Guzzle\Plugin\Md5\Md5ValidatorPlugin::getSubscribedEvents ( )
static

Returns an array of event names this subscriber wants to listen to.

The array keys are event names and the value can be:

  • The method name to call (priority defaults to 0)
  • An array composed of the method name to call and the priority
  • An array of arrays composed of the method names to call and respective priorities, or 0 if unset

For instance:

  • array('eventName' => 'methodName')
  • array('eventName' => array('methodName', $priority))
  • array('eventName' => array(array('methodName1', $priority), array('methodName2')))
Returns
array The event names to listen to

Implements Symfony\Component\EventDispatcher\EventSubscriberInterface.

Definition at line 43 of file Md5ValidatorPlugin.php.

◆ onRequestComplete()

Guzzle\Plugin\Md5\Md5ValidatorPlugin::onRequestComplete ( Event  $event)

{}

Exceptions
UnexpectedValueException

Definition at line 52 of file Md5ValidatorPlugin.php.

Field Documentation

◆ $contentEncoded

bool Guzzle\Plugin\Md5\Md5ValidatorPlugin::$contentEncoded
protected

Whether or not to compare when a Content-Encoding is present

Definition at line 26 of file Md5ValidatorPlugin.php.

Referenced by Guzzle\Plugin\Md5\Md5ValidatorPlugin\__construct().

◆ $contentLengthCutoff

int Guzzle\Plugin\Md5\Md5ValidatorPlugin::$contentLengthCutoff
protected

Maximum Content-Length in bytes to validate

Definition at line 20 of file Md5ValidatorPlugin.php.

Referenced by Guzzle\Plugin\Md5\Md5ValidatorPlugin\__construct().


The documentation for this class was generated from the following file: