Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

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

AbstractTransferEvent.php

Zuletzt modifiziert: 09.10.2024, 12:57 - Dateigröße: 1.61 KiB


 01  <?php
 02  namespace GuzzleHttp\Event;
 03   
 04  use GuzzleHttp\Message\ResponseInterface;
 05  use GuzzleHttp\Ring\Future\FutureInterface;
 06   
 07  /**
 08   * Event that contains transfer statistics, and can be intercepted.
 09   */
 10  abstract class AbstractTransferEvent extends AbstractRequestEvent
 11  {
 12      /**
 13       * Get all transfer information as an associative array if no $name
 14       * argument is supplied, or gets a specific transfer statistic if
 15       * a $name attribute is supplied (e.g., 'total_time').
 16       *
 17       * @param string $name Name of the transfer stat to retrieve
 18       *
 19       * @return mixed|null|array
 20       */
 21      public function getTransferInfo($name = null)
 22      {
 23          if (!$name) {
 24              return $this->transaction->transferInfo;
 25          }
 26   
 27          return isset($this->transaction->transferInfo[$name])
 28              ? $this->transaction->transferInfo[$name]
 29              : null;
 30      }
 31   
 32      /**
 33       * Returns true/false if a response is available.
 34       *
 35       * @return bool
 36       */
 37      public function hasResponse()
 38      {
 39          return !($this->transaction->response instanceof FutureInterface);
 40      }
 41   
 42      /**
 43       * Get the response.
 44       *
 45       * @return ResponseInterface|null
 46       */
 47      public function getResponse()
 48      {
 49          return $this->hasResponse() ? $this->transaction->response : null;
 50      }
 51   
 52      /**
 53       * Intercept the request and associate a response
 54       *
 55       * @param ResponseInterface $response Response to set
 56       */
 57      public function intercept(ResponseInterface $response)
 58      {
 59          $this->transaction->response = $response;
 60          $this->transaction->exception = null;
 61          $this->stopPropagation();
 62      }
 63  }
 64