Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

TransferStats.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 3.04 KiB


001  <?php
002  namespace GuzzleHttp;
003   
004  use Psr\Http\Message\RequestInterface;
005  use Psr\Http\Message\ResponseInterface;
006  use Psr\Http\Message\UriInterface;
007   
008  /**
009   * Represents data at the point after it was transferred either successfully
010   * or after a network error.
011   */
012  final class TransferStats
013  {
014      private $request;
015      private $response;
016      private $transferTime;
017      private $handlerStats;
018      private $handlerErrorData;
019   
020      /**
021       * @param RequestInterface       $request          Request that was sent.
022       * @param ResponseInterface|null $response         Response received (if any)
023       * @param float|null             $transferTime     Total handler transfer time.
024       * @param mixed                  $handlerErrorData Handler error data.
025       * @param array                  $handlerStats     Handler specific stats.
026       */
027      public function __construct(
028          RequestInterface $request,
029          ResponseInterface $response = null,
030          $transferTime = null,
031          $handlerErrorData = null,
032          $handlerStats = []
033      ) {
034          $this->request = $request;
035          $this->response = $response;
036          $this->transferTime = $transferTime;
037          $this->handlerErrorData = $handlerErrorData;
038          $this->handlerStats = $handlerStats;
039      }
040   
041      /**
042       * @return RequestInterface
043       */
044      public function getRequest()
045      {
046          return $this->request;
047      }
048   
049      /**
050       * Returns the response that was received (if any).
051       *
052       * @return ResponseInterface|null
053       */
054      public function getResponse()
055      {
056          return $this->response;
057      }
058   
059      /**
060       * Returns true if a response was received.
061       *
062       * @return bool
063       */
064      public function hasResponse()
065      {
066          return $this->response !== null;
067      }
068   
069      /**
070       * Gets handler specific error data.
071       *
072       * This might be an exception, a integer representing an error code, or
073       * anything else. Relying on this value assumes that you know what handler
074       * you are using.
075       *
076       * @return mixed
077       */
078      public function getHandlerErrorData()
079      {
080          return $this->handlerErrorData;
081      }
082   
083      /**
084       * Get the effective URI the request was sent to.
085       *
086       * @return UriInterface
087       */
088      public function getEffectiveUri()
089      {
090          return $this->request->getUri();
091      }
092   
093      /**
094       * Get the estimated time the request was being transferred by the handler.
095       *
096       * @return float|null Time in seconds.
097       */
098      public function getTransferTime()
099      {
100          return $this->transferTime;
101      }
102   
103      /**
104       * Gets an array of all of the handler specific transfer data.
105       *
106       * @return array
107       */
108      public function getHandlerStats()
109      {
110          return $this->handlerStats;
111      }
112   
113      /**
114       * Get a specific handler statistic from the handler by name.
115       *
116       * @param string $stat Handler specific transfer stat to retrieve.
117       *
118       * @return mixed|null
119       */
120      public function getHandlerStat($stat)
121      {
122          return isset($this->handlerStats[$stat])
123              ? $this->handlerStats[$stat]
124              : null;
125      }
126  }
127