... protected string makeDsn(array $param) $param array 包含 host, port, dbname {return} string 源码: sdk/php/util/XSDataSource.class.php#L877 (显示) protected function makeDsn($param){ $dsn = 'mysql:host=' . (isset($param['host']) ? $param['host'] : 'localhost'); if ...
...isset($param['pass']) ? $param['pass'] : ini_get('mysqli.default_pw'); $port = isset($param['port']) ? $param['port'] : ini_get('mysqli.default_port'); $this->obj = new mysqli($host, $user, $pass, '', $port); if ($this->obj->connect_error) { throw new XSException("Can not connect to ...
...(is_int($conn) || is_numeric($conn)) { $host = 'localhost'; $port = intval($conn); } elseif (!strncmp($conn, 'file://', 7)) { // write-only for saving index exchangable data to file // NOTE: this will cause file content be turncated $conn = substr($conn, 7); ...
... protected string makeDsn(array $param) $param array 包含 host, port, dbname {return} string 源码: sdk/php/util/XSDataSource.class.php#L877 (显示) protected function makeDsn($param){ $dsn = 'mysql:host=' . (isset($param['host']) ? $param['host'] : 'localhost'); if ...
...param){ $dsn = "pgsql:host={$param['host']};"; $dsn .= isset($param['port']) ? "port={$param['port']};" : ''; $dsn .= "dbname={$param['dbname']};client_encoding=utf-8"; return $dsn;} 生成 Postgres DSN
...nect($param){ $dsn = "host={$param['host']} "; $dsn .= isset($param['port']) ? "port={$param['port']} " : ''; $dsn .= "dbname={$param['dbname']} user={$param['user']} password={$param['pass']}"; if (!($this->link = @pg_connect($dsn))) { throw new XSException('Error connecting to P...
...$param['host'] : ini_get('mysql.default_host'); $host .= (isset($param['port']) && $param['port'] != 3306) ? ':' . $param['port'] : ''; $user = isset($param['user']) ? $param['user'] : ini_get('mysql.default_user'); $pass = isset($param['pass']) ? $param['pass'] : ini_get('mysql.default_pw'...
...isset($param['pass']) ? $param['pass'] : ini_get('mysqli.default_pw'); $port = isset($param['port']) ? $param['port'] : ini_get('mysqli.default_port'); $this->obj = new mysqli($host, $user, $pass, '', $port); if ($this->obj->connect_error) { throw new XSException("Can not connect to ...
...param){ $dsn = "pgsql:host={$param['host']};"; $dsn .= isset($param['port']) ? "port={$param['port']};" : ''; $dsn .= "dbname={$param['dbname']};client_encoding=utf-8"; return $dsn;} 生成 Postgres DSN setUtf8() 方法 public void setUtf8() 源码: sdk/php/util/XSDataS...
...nect($param){ $dsn = "host={$param['host']} "; $dsn .= isset($param['port']) ? "port={$param['port']} " : ''; $dsn .= "dbname={$param['dbname']} user={$param['user']} password={$param['pass']}"; if (!($this->link = @pg_connect($dsn))) { throw new XSException('Error connecting to P...