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

BaseAdapter.php

Zuletzt modifiziert: 02.04.2025, 15:04 - Dateigröße: 1.34 KiB


01  <?php
02   
03  declare(strict_types=1);
04   
05  namespace ProxyManager\Factory\RemoteObject\Adapter;
06   
07  use ProxyManager\Factory\RemoteObject\AdapterInterface;
08  use Zend\Server\Client;
09   
10  /**
11   * Remote Object base adapter
12   *
13   * @author Vincent Blanchon <blanchon.vincent@gmail.com>
14   * @license MIT
15   */
16  abstract class BaseAdapter implements AdapterInterface
17  {
18      /**
19       * Adapter client
20       *
21       * @var \Zend\Server\Client
22       */
23      protected $client;
24   
25      /**
26       * Service name mapping
27       *
28       * @var string[]
29       */
30      protected $map = [];
31   
32      /**
33       * Constructor
34       *
35       * @param Client $client
36       * @param array  $map    map of service names to their aliases
37       */
38      public function __construct(Client $client, array $map = [])
39      {
40          $this->client = $client;
41          $this->map    = $map;
42      }
43   
44      /**
45       * {@inheritDoc}
46       */
47      public function call(string $wrappedClass, string $method, array $params = [])
48      {
49          $serviceName = $this->getServiceName($wrappedClass, $method);
50   
51          if (\array_key_exists($serviceName, $this->map)) {
52              $serviceName = $this->map[$serviceName];
53          }
54   
55          return $this->client->call($serviceName, $params);
56      }
57   
58      /**
59       * Get the service name will be used by the adapter
60       */
61      abstract protected function getServiceName(string $wrappedClass, string $method) : string;
62  }
63