當前位置: 首頁>>代碼示例>>PHP>>正文


PHP driver_interface::sql_connect方法代碼示例

本文整理匯總了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);
 }
開發者ID:007durgesh219,項目名稱:phpbb,代碼行數:21,代碼來源:create_schema_file.php

示例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);
 }
開發者ID:007durgesh219,項目名稱:phpbb,代碼行數:21,代碼來源:add_tables.php

示例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;
 }
開發者ID:Tarendai,項目名稱:spring-website,代碼行數:14,代碼來源:container_builder.php


注:本文中的phpbb\db\driver\driver_interface::sql_connect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。