Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
1.82% covered (danger)
1.82%
1 / 55
CRAP
3.23% covered (danger)
3.23%
2 / 62
factory
0.00% covered (danger)
0.00%
0 / 1
1.82% covered (danger)
1.82%
1 / 55
2898.20
3.23% covered (danger)
3.23%
2 / 62
 __construct
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 get_driver
0.00% covered (danger)
0.00%
0 / 1
6.00
0.00% covered (danger)
0.00%
0 / 3
 set_driver
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 2
 set_debug_load_time
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 2
 set_debug_sql_explain
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 2
 get_sql_layer
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 get_db_name
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 get_any_char
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 get_one_char
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 get_db_connect_id
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 get_sql_error_triggered
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 get_sql_error_sql
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 get_transaction
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 get_sql_time
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 get_sql_error_returned
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 get_multi_insert
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 set_multi_insert
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 2
 get_row_count
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 get_estimated_row_count
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_lower_text
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_error
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_buffer_nested_transactions
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_bit_or
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_server_info
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_return_on_error
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_build_array
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_fetchrowset
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_transaction
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_concatenate
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_case
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_build_query
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_fetchfield
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_fetchrow
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 cast_expr_to_bigint
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_nextid
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_last_inserted_id
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_add_num_queries
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_query_limit
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_query
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 cast_expr_to_string
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_connect
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_bit_and
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_freeresult
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_num_queries
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_multi_insert
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_affectedrows
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_close
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_rowseek
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_escape
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_like_expression
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_not_like_expression
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_report
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_in_set
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 sql_quote
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
 clean_query_id
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 1
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\db\driver;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Database Abstraction Layer
*/
class factory implements driver_interface
{
    /**
    * @var driver_interface
    */
    protected $driver = null;
    /**
    * @var ContainerInterface
    */
    protected $container;
    /**
    * Constructor.
    *
    * @param ContainerInterface $container A ContainerInterface instance
    */
    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;
    }
    /**
    * Return the current driver (and retrieved it from the container if necessary)
    *
    * @return driver_interface
    */
    protected function get_driver()
    {
        if ($this->driver === null)
        {
            $this->driver = $this->container->get('dbal.conn.driver');
        }
        return $this->driver;
    }
    /**
    * Set the current driver
    *
    * @param driver_interface $driver
    */
    public function set_driver(driver_interface $driver)
    {
        $this->driver = $driver;
    }
    /**
    * {@inheritdoc}
    */
    public function set_debug_load_time($value)
    {
        $this->get_driver()->set_debug_load_time($value);
    }
    /**
    * {@inheritdoc}
    */
    public function set_debug_sql_explain($value)
    {
        $this->get_driver()->set_debug_sql_explain($value);
    }
    /**
    * {@inheritdoc}
    */
    public function get_sql_layer()
    {
        return $this->get_driver()->get_sql_layer();
    }
    /**
    * {@inheritdoc}
    */
    public function get_db_name()
    {
        return $this->get_driver()->get_db_name();
    }
    /**
    * {@inheritdoc}
    */
    public function get_any_char()
    {
        return $this->get_driver()->get_any_char();
    }
    /**
    * {@inheritdoc}
    */
    public function get_one_char()
    {
        return $this->get_driver()->get_one_char();
    }
    /**
    * {@inheritdoc}
    */
    public function get_db_connect_id()
    {
        return $this->get_driver()->get_db_connect_id();
    }
    /**
    * {@inheritdoc}
    */
    public function get_sql_error_triggered()
    {
        return $this->get_driver()->get_sql_error_triggered();
    }
    /**
    * {@inheritdoc}
    */
    public function get_sql_error_sql()
    {
        return $this->get_driver()->get_sql_error_sql();
    }
    /**
    * {@inheritdoc}
    */
    public function get_transaction()
    {
        return $this->get_driver()->get_transaction();
    }
    /**
    * {@inheritdoc}
    */
    public function get_sql_time()
    {
        return $this->get_driver()->get_sql_time();
    }
    /**
    * {@inheritdoc}
    */
    public function get_sql_error_returned()
    {
        return $this->get_driver()->get_sql_error_returned();
    }
    /**
    * {@inheritdoc}
    */
    public function get_multi_insert()
    {
        return $this->get_driver()->get_multi_insert();
    }
    /**
    * {@inheritdoc}
    */
    public function set_multi_insert($multi_insert)
    {
        $this->get_driver()->set_multi_insert($multi_insert);
    }
    /**
    * {@inheritdoc}
    */
    public function get_row_count($table_name)
    {
        return $this->get_driver()->get_row_count($table_name);
    }
    /**
    * {@inheritdoc}
    */
    public function get_estimated_row_count($table_name)
    {
        return $this->get_driver()->get_estimated_row_count($table_name);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_lower_text($column_name)
    {
        return $this->get_driver()->sql_lower_text($column_name);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_error($sql = '')
    {
        return $this->get_driver()->sql_error($sql);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_buffer_nested_transactions()
    {
        return $this->get_driver()->sql_buffer_nested_transactions();
    }
    /**
    * {@inheritdoc}
    */
    public function sql_bit_or($column_name, $bit, $compare = '')
    {
        return $this->get_driver()->sql_bit_or($column_name, $bit, $compare);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_server_info($raw = false, $use_cache = true)
    {
        return $this->get_driver()->sql_server_info($raw, $use_cache);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_return_on_error($fail = false)
    {
        return $this->get_driver()->sql_return_on_error($fail);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_build_array($query, $assoc_ary = array())
    {
        return $this->get_driver()->sql_build_array($query, $assoc_ary);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_fetchrowset($query_id = false)
    {
        return $this->get_driver()->sql_fetchrowset($query_id);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_transaction($status = 'begin')
    {
        return $this->get_driver()->sql_transaction($status);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_concatenate($expr1, $expr2)
    {
        return $this->get_driver()->sql_concatenate($expr1, $expr2);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_case($condition, $action_true, $action_false = false)
    {
        return $this->get_driver()->sql_case($condition, $action_true, $action_false);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_build_query($query, $array)
    {
        return $this->get_driver()->sql_build_query($query, $array);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_fetchfield($field, $rownum = false, $query_id = false)
    {
        return $this->get_driver()->sql_fetchfield($field, $rownum, $query_id);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_fetchrow($query_id = false)
    {
        return $this->get_driver()->sql_fetchrow($query_id);
    }
    /**
    * {@inheritdoc}
    */
    public function cast_expr_to_bigint($expression)
    {
        return $this->get_driver()->cast_expr_to_bigint($expression);
    }
    /**
     * {@inheritdoc}
     */
    public function sql_nextid()
    {
        return $this->get_driver()->sql_last_inserted_id();
    }
    /**
     * {@inheritdoc}
     */
    public function sql_last_inserted_id()
    {
        return $this->get_driver()->sql_last_inserted_id();
    }
    /**
    * {@inheritdoc}
    */
    public function sql_add_num_queries($cached = false)
    {
        return $this->get_driver()->sql_add_num_queries($cached);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
    {
        return $this->get_driver()->sql_query_limit($query, $total, $offset, $cache_ttl);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_query($query = '', $cache_ttl = 0)
    {
        return $this->get_driver()->sql_query($query, $cache_ttl);
    }
    /**
    * {@inheritdoc}
    */
    public function cast_expr_to_string($expression)
    {
        return $this->get_driver()->cast_expr_to_string($expression);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
    {
        throw new \Exception('Disabled method.');
    }
    /**
    * {@inheritdoc}
    */
    public function sql_bit_and($column_name, $bit, $compare = '')
    {
        return $this->get_driver()->sql_bit_and($column_name, $bit, $compare);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_freeresult($query_id = false)
    {
        return $this->get_driver()->sql_freeresult($query_id);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_num_queries($cached = false)
    {
        return $this->get_driver()->sql_num_queries($cached);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_multi_insert($table, $sql_ary)
    {
        return $this->get_driver()->sql_multi_insert($table, $sql_ary);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_affectedrows()
    {
        return $this->get_driver()->sql_affectedrows();
    }
    /**
    * {@inheritdoc}
    */
    public function sql_close()
    {
        return $this->get_driver()->sql_close();
    }
    /**
    * {@inheritdoc}
    */
    public function sql_rowseek($rownum, &$query_id)
    {
        return $this->get_driver()->sql_rowseek($rownum, $query_id);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_escape($msg)
    {
        return $this->get_driver()->sql_escape($msg);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_like_expression($expression)
    {
        return $this->get_driver()->sql_like_expression($expression);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_not_like_expression($expression)
    {
        return $this->get_driver()->sql_not_like_expression($expression);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_report($mode, $query = '')
    {
        return $this->get_driver()->sql_report($mode, $query);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_in_set($field, $array, $negate = false, $allow_empty_set = false)
    {
        return $this->get_driver()->sql_in_set($field, $array, $negate, $allow_empty_set);
    }
    /**
    * {@inheritdoc}
    */
    public function sql_quote($msg)
    {
        return $this->get_driver()->sql_quote($msg);
    }
    /**
     * {@inheritDoc}
     */
    public function clean_query_id($query_id)
    {
        return $this->get_driver()->clean_query_id($query_id);
    }
}