本文整理汇总了PHP中phpbb\db\driver\driver_interface::sql_connect方法的典型用法代码示例。如果您正苦于以下问题:PHP driver_interface::sql_connect方法的具体用法?PHP driver_interface::sql_connect怎么用?PHP driver_interface::sql_connect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpbb\db\driver\driver_interface
的用法示例。
在下文中一共展示了driver_interface::sql_connect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* @param \phpbb\install\helper\config $config Installer's config provider
* @param \phpbb\install\helper\database $db_helper Installer's database helper
* @param \phpbb\filesystem\filesystem_interface $filesystem Filesystem service
* @param string $phpbb_root_path Path phpBB's root
* @param string $php_ext Extension of PHP files
*/
public function __construct(\phpbb\install\helper\config $config, \phpbb\install\helper\database $db_helper, \phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path, $php_ext)
{
$dbms = $db_helper->get_available_dbms($config->get('dbms'));
$dbms = $dbms[$config->get('dbms')]['DRIVER'];
$this->db = new $dbms();
$this->db->sql_connect($config->get('dbhost'), $config->get('dbuser'), $config->get('dbpasswd'), $config->get('dbname'), $config->get('dbport'), false, false);
$this->config = $config;
$this->filesystem = $filesystem;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
parent::__construct(true);
}
示例2: __construct
/**
* Constructor
*
* @param \phpbb\install\helper\config $config
* @param \phpbb\install\helper\database $db_helper
* @param \phpbb\filesystem\filesystem_interface $filesystem
* @param string $phpbb_root_path
*/
public function __construct(\phpbb\install\helper\config $config, \phpbb\install\helper\database $db_helper, \phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
{
$dbms = $db_helper->get_available_dbms($config->get('dbms'));
$dbms = $dbms[$config->get('dbms')]['DRIVER'];
$factory = new \phpbb\db\tools\factory();
$this->db = new $dbms();
$this->db->sql_connect($config->get('dbhost'), $config->get('dbuser'), $config->get('dbpasswd'), $config->get('dbname'), $config->get('dbport'), false, false);
$this->config = $config;
$this->db_tools = $factory->get($this->db);
$this->filesystem = $filesystem;
$this->schema_file_path = $phpbb_root_path . 'store/schema.json';
parent::__construct(true);
}
示例3: get_dbal_connection
/**
* Get DB connection.
*
* @return \phpbb\db\driver\driver_interface
*/
protected function get_dbal_connection()
{
if ($this->dbal_connection === null) {
$dbal_driver_class = $this->config_php_file->convert_30_dbms_to_31($this->config_php_file->get('dbms'));
$this->dbal_connection = new $dbal_driver_class();
$this->dbal_connection->sql_connect($this->config_php_file->get('dbhost'), $this->config_php_file->get('dbuser'), $this->config_php_file->get('dbpasswd'), $this->config_php_file->get('dbname'), $this->config_php_file->get('dbport'), defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK);
}
return $this->dbal_connection;
}