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

BaseAdapter.php

Zuletzt modifiziert: 09.10.2024, 12:59 - Dateigröße: 2.29 KiB


01  <?php
02  /*
03   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
04   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
05   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
06   * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
07   * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
08   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
09   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14   *
15   * This software consists of voluntary contributions made by many individuals
16   * and is licensed under the MIT license.
17   */
18   
19  namespace ProxyManager\Factory\RemoteObject\Adapter;
20   
21  use ProxyManager\Factory\RemoteObject\AdapterInterface;
22  use Zend\Server\Client;
23   
24  /**
25   * Remote Object base adapter
26   *
27   * @author Vincent Blanchon <blanchon.vincent@gmail.com>
28   * @license MIT
29   */
30  abstract class BaseAdapter implements AdapterInterface
31  {
32      /**
33       * Adapter client
34       *
35       * @var \Zend\Server\Client
36       */
37      protected $client;
38   
39      /**
40       * Service name mapping
41       *
42       * @var string[]
43       */
44      protected $map = array();
45   
46      /**
47       * Constructor
48       *
49       * @param Client $client
50       * @param array  $map    map of service names to their aliases
51       */
52      public function __construct(Client $client, array $map = array())
53      {
54          $this->client = $client;
55          $this->map    = $map;
56      }
57   
58      /**
59       * {@inheritDoc}
60       */
61      public function call($wrappedClass, $method, array $params = array())
62      {
63          $serviceName = $this->getServiceName($wrappedClass, $method);
64   
65          if (isset($this->map[$serviceName])) {
66              $serviceName = $this->map[$serviceName];
67          }
68   
69          return $this->client->call($serviceName, $params);
70      }
71   
72      /**
73       * Get the service name will be used by the adapter
74       *
75       * @param string $wrappedClass
76       * @param string $method
77       *
78       * @return string Service name
79       */
80      abstract protected function getServiceName($wrappedClass, $method);
81  }
82