[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/phpbb/db/driver/ -> factory.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  namespace phpbb\db\driver;
  15  
  16  use \Symfony\Component\DependencyInjection\ContainerInterface;
  17  
  18  /**
  19  * Database Abstraction Layer
  20  */
  21  class factory implements driver_interface
  22  {
  23      /**
  24      * @var driver_interface
  25      */
  26      protected $driver = null;
  27  
  28      /**
  29      * @var ContainerInterface
  30      */
  31      protected $container;
  32  
  33      /**
  34      * Constructor.
  35      *
  36      * @param ContainerInterface $container A ContainerInterface instance
  37      */
  38  	public function __construct(ContainerInterface $container)
  39      {
  40          $this->container = $container;
  41      }
  42  
  43      /**
  44      * Return the current driver (and retrieved it from the container if necessary)
  45      *
  46      * @return driver_interface
  47      */
  48  	protected function get_driver()
  49      {
  50          if ($this->driver === null)
  51          {
  52              $this->driver = $this->container->get('dbal.conn.driver');
  53          }
  54  
  55          return $this->driver;
  56      }
  57  
  58      /**
  59      * Set the current driver
  60      *
  61      * @param driver_interface $driver
  62      */
  63  	public function set_driver(driver_interface $driver)
  64      {
  65          $this->driver = $driver;
  66      }
  67  
  68      /**
  69      * {@inheritdoc}
  70      */
  71  	public function get_sql_layer()
  72      {
  73          return $this->get_driver()->get_sql_layer();
  74      }
  75  
  76      /**
  77      * {@inheritdoc}
  78      */
  79  	public function get_db_name()
  80      {
  81          return $this->get_driver()->get_db_name();
  82      }
  83  
  84      /**
  85      * {@inheritdoc}
  86      */
  87  	public function get_any_char()
  88      {
  89          return $this->get_driver()->get_any_char();
  90      }
  91  
  92      /**
  93      * {@inheritdoc}
  94      */
  95  	public function get_one_char()
  96      {
  97          return $this->get_driver()->get_one_char();
  98      }
  99  
 100      /**
 101      * {@inheritdoc}
 102      */
 103  	public function get_db_connect_id()
 104      {
 105          return $this->get_driver()->get_db_connect_id();
 106      }
 107  
 108      /**
 109      * {@inheritdoc}
 110      */
 111  	public function get_sql_error_triggered()
 112      {
 113          return $this->get_driver()->get_sql_error_triggered();
 114      }
 115  
 116      /**
 117      * {@inheritdoc}
 118      */
 119  	public function get_sql_error_sql()
 120      {
 121          return $this->get_driver()->get_sql_error_sql();
 122      }
 123  
 124      /**
 125      * {@inheritdoc}
 126      */
 127  	public function get_transaction()
 128      {
 129          return $this->get_driver()->get_transaction();
 130      }
 131  
 132      /**
 133      * {@inheritdoc}
 134      */
 135  	public function get_sql_time()
 136      {
 137          return $this->get_driver()->get_sql_time();
 138      }
 139  
 140      /**
 141      * {@inheritdoc}
 142      */
 143  	public function get_sql_error_returned()
 144      {
 145          return $this->get_driver()->get_sql_error_returned();
 146      }
 147  
 148      /**
 149      * {@inheritdoc}
 150      */
 151  	public function get_multi_insert()
 152      {
 153          return $this->get_driver()->get_multi_insert();
 154      }
 155  
 156      /**
 157      * {@inheritdoc}
 158      */
 159  	public function set_multi_insert($multi_insert)
 160      {
 161          $this->get_driver()->set_multi_insert($multi_insert);
 162      }
 163  
 164      /**
 165      * {@inheritdoc}
 166      */
 167  	public function get_row_count($table_name)
 168      {
 169          return $this->get_driver()->get_row_count($table_name);
 170      }
 171  
 172      /**
 173      * {@inheritdoc}
 174      */
 175  	public function get_estimated_row_count($table_name)
 176      {
 177          return $this->get_driver()->get_estimated_row_count($table_name);
 178      }
 179  
 180      /**
 181      * {@inheritdoc}
 182      */
 183  	public function sql_lower_text($column_name)
 184      {
 185          return $this->get_driver()->sql_lower_text($column_name);
 186      }
 187  
 188      /**
 189      * {@inheritdoc}
 190      */
 191  	public function sql_error($sql = '')
 192      {
 193          return $this->get_driver()->sql_error($sql);
 194      }
 195  
 196      /**
 197      * {@inheritdoc}
 198      */
 199  	public function sql_buffer_nested_transactions()
 200      {
 201          return $this->get_driver()->sql_buffer_nested_transactions();
 202      }
 203  
 204      /**
 205      * {@inheritdoc}
 206      */
 207  	public function sql_bit_or($column_name, $bit, $compare = '')
 208      {
 209          return $this->get_driver()->sql_bit_or($column_name, $bit, $compare);
 210      }
 211  
 212      /**
 213      * {@inheritdoc}
 214      */
 215  	public function sql_server_info($raw = false, $use_cache = true)
 216      {
 217          return $this->get_driver()->sql_server_info($raw, $use_cache);
 218      }
 219  
 220      /**
 221      * {@inheritdoc}
 222      */
 223  	public function sql_return_on_error($fail = false)
 224      {
 225          return $this->get_driver()->sql_return_on_error($fail);
 226      }
 227  
 228      /**
 229      * {@inheritdoc}
 230      */
 231  	public function sql_build_array($query, $assoc_ary = array())
 232      {
 233          return $this->get_driver()->sql_build_array($query, $assoc_ary);
 234      }
 235  
 236      /**
 237      * {@inheritdoc}
 238      */
 239  	public function sql_fetchrowset($query_id = false)
 240      {
 241          return $this->get_driver()->sql_fetchrowset($query_id);
 242      }
 243  
 244      /**
 245      * {@inheritdoc}
 246      */
 247  	public function sql_transaction($status = 'begin')
 248      {
 249          return $this->get_driver()->sql_transaction($status);
 250      }
 251  
 252      /**
 253      * {@inheritdoc}
 254      */
 255  	public function sql_concatenate($expr1, $expr2)
 256      {
 257          return $this->get_driver()->sql_concatenate($expr1, $expr2);
 258      }
 259  
 260      /**
 261      * {@inheritdoc}
 262      */
 263  	public function sql_case($condition, $action_true, $action_false = false)
 264      {
 265          return $this->get_driver()->sql_case($condition, $action_true, $action_false);
 266      }
 267  
 268      /**
 269      * {@inheritdoc}
 270      */
 271  	public function sql_build_query($query, $array)
 272      {
 273          return $this->get_driver()->sql_build_query($query, $array);
 274      }
 275  
 276      /**
 277      * {@inheritdoc}
 278      */
 279  	public function sql_fetchfield($field, $rownum = false, $query_id = false)
 280      {
 281          return $this->get_driver()->sql_fetchfield($field, $rownum, $query_id);
 282      }
 283  
 284      /**
 285      * {@inheritdoc}
 286      */
 287  	public function sql_fetchrow($query_id = false)
 288      {
 289          return $this->get_driver()->sql_fetchrow($query_id);
 290      }
 291  
 292      /**
 293      * {@inheritdoc}
 294      */
 295  	public function cast_expr_to_bigint($expression)
 296      {
 297          return $this->get_driver()->cast_expr_to_bigint($expression);
 298      }
 299  
 300      /**
 301      * {@inheritdoc}
 302      */
 303  	public function sql_nextid()
 304      {
 305          return $this->get_driver()->sql_nextid();
 306      }
 307  
 308      /**
 309      * {@inheritdoc}
 310      */
 311  	public function sql_add_num_queries($cached = false)
 312      {
 313          return $this->get_driver()->sql_add_num_queries($cached);
 314      }
 315  
 316      /**
 317      * {@inheritdoc}
 318      */
 319  	public function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
 320      {
 321          return $this->get_driver()->sql_query_limit($query, $total, $offset, $cache_ttl);
 322      }
 323  
 324      /**
 325      * {@inheritdoc}
 326      */
 327  	public function sql_query($query = '', $cache_ttl = 0)
 328      {
 329          return $this->get_driver()->sql_query($query, $cache_ttl);
 330      }
 331  
 332      /**
 333      * {@inheritdoc}
 334      */
 335  	public function cast_expr_to_string($expression)
 336      {
 337          return $this->get_driver()->cast_expr_to_string($expression);
 338      }
 339  
 340      /**
 341      * {@inheritdoc}
 342      */
 343  	public function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
 344      {
 345          throw new \Exception('Disabled method.');
 346      }
 347  
 348      /**
 349      * {@inheritdoc}
 350      */
 351  	public function sql_bit_and($column_name, $bit, $compare = '')
 352      {
 353          return $this->get_driver()->sql_bit_and($column_name, $bit, $compare);
 354      }
 355  
 356      /**
 357      * {@inheritdoc}
 358      */
 359  	public function sql_freeresult($query_id = false)
 360      {
 361          return $this->get_driver()->sql_freeresult($query_id);
 362      }
 363  
 364      /**
 365      * {@inheritdoc}
 366      */
 367  	public function sql_num_queries($cached = false)
 368      {
 369          return $this->get_driver()->sql_num_queries($cached);
 370      }
 371  
 372      /**
 373      * {@inheritdoc}
 374      */
 375  	public function sql_multi_insert($table, $sql_ary)
 376      {
 377          return $this->get_driver()->sql_multi_insert($table, $sql_ary);
 378      }
 379  
 380      /**
 381      * {@inheritdoc}
 382      */
 383  	public function sql_affectedrows()
 384      {
 385          return $this->get_driver()->sql_affectedrows();
 386      }
 387  
 388      /**
 389      * {@inheritdoc}
 390      */
 391  	public function sql_close()
 392      {
 393          return $this->get_driver()->sql_close();
 394      }
 395  
 396      /**
 397      * {@inheritdoc}
 398      */
 399  	public function sql_rowseek($rownum, &$query_id)
 400      {
 401          return $this->get_driver()->sql_rowseek($rownum, $query_id);
 402      }
 403  
 404      /**
 405      * {@inheritdoc}
 406      */
 407  	public function sql_escape($msg)
 408      {
 409          return $this->get_driver()->sql_escape($msg);
 410      }
 411  
 412      /**
 413      * {@inheritdoc}
 414      */
 415  	public function sql_like_expression($expression)
 416      {
 417          return $this->get_driver()->sql_like_expression($expression);
 418      }
 419  
 420      /**
 421      * {@inheritdoc}
 422      */
 423  	public function sql_not_like_expression($expression)
 424      {
 425          return $this->get_driver()->sql_not_like_expression($expression);
 426      }
 427  
 428      /**
 429      * {@inheritdoc}
 430      */
 431  	public function sql_report($mode, $query = '')
 432      {
 433          return $this->get_driver()->sql_report($mode, $query);
 434      }
 435  
 436      /**
 437      * {@inheritdoc}
 438      */
 439  	public function sql_in_set($field, $array, $negate = false, $allow_empty_set = false)
 440      {
 441          return $this->get_driver()->sql_in_set($field, $array, $negate, $allow_empty_set);
 442      }
 443  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1