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

factory.php

Zuletzt modifiziert: 02.04.2025, 15:02 - Dateigröße: 1.19 KiB


01  <?php
02  /**
03  *
04  * This file is part of the phpBB Forum Software package.
05  *
06  * @copyright (c) phpBB Limited <https://www.phpbb.com>
07  * @license GNU General Public License, version 2 (GPL-2.0)
08  *
09  * For full copyright and license information, please see
10  * the docs/CREDITS.txt file.
11  *
12  */
13   
14  namespace phpbb\db\tools;
15   
16  /**
17   * A factory which serves the suitable tools instance for the given dbal
18   */
19  class factory
20  {
21      /**
22       * @param mixed $db_driver
23       * @param bool $return_statements
24       * @return \phpbb\db\tools\tools_interface
25       */
26      public function get($db_driver, $return_statements = false)
27      {
28          if ($db_driver instanceof \phpbb\db\driver\mssql_base)
29          {
30              return new \phpbb\db\tools\mssql($db_driver, $return_statements);
31          }
32          else if ($db_driver instanceof \phpbb\db\driver\postgres)
33          {
34              return new \phpbb\db\tools\postgres($db_driver, $return_statements);
35          }
36          else if ($db_driver instanceof \phpbb\db\driver\sqlite3)
37          {
38              return new \phpbb\db\tools\sqlite3($db_driver, $return_statements);
39          }
40          else if ($db_driver instanceof \phpbb\db\driver\driver_interface)
41          {
42              return new \phpbb\db\tools\tools($db_driver, $return_statements);
43          }
44   
45          throw new \InvalidArgumentException('Invalid database driver given');
46      }
47  }
48