[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/symfony/var-dumper/Dumper/ -> ServerDumper.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of the Symfony package.
   5   *
   6   * (c) Fabien Potencier <[email protected]>
   7   *
   8   * For the full copyright and license information, please view the LICENSE
   9   * file that was distributed with this source code.
  10   */
  11  
  12  namespace Symfony\Component\VarDumper\Dumper;
  13  
  14  use Symfony\Component\VarDumper\Cloner\Data;
  15  use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
  16  use Symfony\Component\VarDumper\Server\Connection;
  17  
  18  /**
  19   * ServerDumper forwards serialized Data clones to a server.
  20   *
  21   * @author Maxime Steinhausser <[email protected]>
  22   */
  23  class ServerDumper implements DataDumperInterface
  24  {
  25      private $connection;
  26      private $wrappedDumper;
  27  
  28      /**
  29       * @param string                     $host             The server host
  30       * @param DataDumperInterface|null   $wrappedDumper    A wrapped instance used whenever we failed contacting the server
  31       * @param ContextProviderInterface[] $contextProviders Context providers indexed by context name
  32       */
  33      public function __construct(string $host, DataDumperInterface $wrappedDumper = null, array $contextProviders = [])
  34      {
  35          $this->connection = new Connection($host, $contextProviders);
  36          $this->wrappedDumper = $wrappedDumper;
  37      }
  38  
  39      public function getContextProviders(): array
  40      {
  41          return $this->connection->getContextProviders();
  42      }
  43  
  44      /**
  45       * {@inheritdoc}
  46       */
  47      public function dump(Data $data)
  48      {
  49          if (!$this->connection->write($data) && $this->wrappedDumper) {
  50              $this->wrappedDumper->dump($data);
  51          }
  52      }
  53  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer