当前位置: 首页>>代码示例>>PHP>>正文


PHP ibase_service_attach函数代码示例

本文整理汇总了PHP中ibase_service_attach函数的典型用法代码示例。如果您正苦于以下问题:PHP ibase_service_attach函数的具体用法?PHP ibase_service_attach怎么用?PHP ibase_service_attach使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ibase_service_attach函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: connect

 /**
 +----------------------------------------------------------
 * 连接数据库方法
 +----------------------------------------------------------
 * @access public 
 +----------------------------------------------------------
 * @throws ThinkExecption
 +----------------------------------------------------------
 */
 public function connect($config = '', $linkNum = 0)
 {
     if (!isset($this->linkID[$linkNum])) {
         if (empty($config)) {
             $config = $this->config;
         }
         $conn = $this->pconnect ? 'ibase_pconnect' : 'ibase_connect';
         $this->linkID[$linkNum] = $conn($config['hostname'] . '/' . $config['hostport'] . ':' . $config['database'], $config['username'], $config['password']);
         if (!$this->linkID[$linkNum]) {
             throw_exception(ibase_errmsg());
             return False;
         }
         //剑雷 2007.12.28
         if (($svc = ibase_service_attach($config['hostname'], $config['username'], $config['password'])) != FALSE) {
             $ibase_info = ibase_server_info($svc, IBASE_SVC_SERVER_VERSION) . '/' . ibase_server_info($svc, IBASE_SVC_IMPLEMENTATION);
             ibase_service_detach($svc);
         } else {
             $ibase_info = 'Unable to Determine';
         }
         $this->dbVersion = $ibase_info;
         // 标记连接成功
         $this->connected = true;
         // 注销数据库连接配置信息
         if (1 != C('DB_DEPLOY_TYPE')) {
             unset($this->config);
         }
     }
     return $this->linkID[$linkNum];
 }
开发者ID:skiman100,项目名称:thinksns,代码行数:38,代码来源:DbIbase.class.php

示例2: _backup

 /**
  * Export
  *
  * @param	string	$filename
  * @return	mixed
  */
 protected function _backup($filename)
 {
     if ($service = ibase_service_attach($this->db->hostname, $this->db->username, $this->db->password)) {
         $res = ibase_backup($service, $this->db->database, $filename . '.fbk');
         // Close the service connection
         ibase_service_detach($service);
         return $res;
     }
     return FALSE;
 }
开发者ID:NaszvadiG,项目名称:codeigniter-database-standalone,代码行数:16,代码来源:ibase_utility.php

示例3: sql_connect

 /**
  * Connect to server
  */
 function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
 {
     $this->persistency = $persistency;
     $this->user = $sqluser;
     $this->server = $sqlserver . ($port ? ':' . $port : '');
     $this->dbname = $database;
     $this->db_connect_id = $this->persistency ? @ibase_pconnect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3);
     $this->service_handle = function_exists('ibase_service_attach') ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false;
     return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
 }
开发者ID:jambik,项目名称:elenaburgon,代码行数:13,代码来源:firebird.php

示例4: connect

 function connect($server, $username, $password)
 {
     $this->_link = ibase_connect($server, $username, $password);
     if ($this->_link) {
         $url_parts = explode(':', $server);
         $this->service_link = ibase_service_attach($url_parts[0], $username, $password);
         $this->server_info = ibase_server_info($this->service_link, IBASE_SVC_SERVER_VERSION);
     } else {
         $this->errno = ibase_errcode();
         $this->error = ibase_errmsg();
     }
     return (bool) $this->_link;
 }
开发者ID:tlandn,项目名称:akvo-sites-zz-template,代码行数:13,代码来源:firebird.inc.php

示例5: version

 /**
  * Database version number
  *
  * @return    string
  */
 public function version()
 {
     if (isset($this->data_cache['version'])) {
         return $this->data_cache['version'];
     }
     if ($service = ibase_service_attach($this->hostname, $this->username, $this->password)) {
         $this->data_cache['version'] = ibase_server_info($service, IBASE_SVC_SERVER_VERSION);
         // Don't keep the service open
         ibase_service_detach($service);
         return $this->data_cache['version'];
     }
     return FALSE;
 }
开发者ID:at15,项目名称:codeignitordb,代码行数:18,代码来源:ibase_driver.php

示例6: sql_connect

 /**
  * Connect to server
  */
 function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
 {
     $this->persistency = $persistency;
     $this->user = $sqluser;
     $this->server = $sqlserver . ($port ? ':' . $port : '');
     $this->dbname = str_replace('\\', '/', $database);
     // There are three possibilities to connect to an interbase db
     if (!$this->server) {
         $use_database = $this->dbname;
     } else {
         if (strpos($this->server, '//') === 0) {
             $use_database = $this->server . $this->dbname;
         } else {
             $use_database = $this->server . ':' . $this->dbname;
         }
     }
     $this->db_connect_id = $this->persistency ? @ibase_pconnect($use_database, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($use_database, $this->user, $sqlpassword, false, false, 3);
     $this->service_handle = function_exists('ibase_service_attach') && $this->server ? @ibase_service_attach($this->server, $this->user, $sqlpassword) : false;
     return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
 }
开发者ID:BACKUPLIB,项目名称:mwenhanced,代码行数:23,代码来源:firebird.php

示例7: sql_connect

 /**
  * Connect to server
  */
 function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
 {
     $this->persistency = $persistency;
     $this->user = $sqluser;
     $this->server = $sqlserver . ($port ? ':' . $port : '');
     $this->dbname = str_replace('\\', '/', $database);
     // There are three possibilities to connect to an interbase db
     if (!$this->server) {
         $use_database = $this->dbname;
     } else {
         if (strpos($this->server, '//') === 0) {
             $use_database = $this->server . $this->dbname;
         } else {
             $use_database = $this->server . ':' . $this->dbname;
         }
     }
     if ($this->persistency) {
         if (!function_exists('ibase_pconnect')) {
             $this->connect_error = 'ibase_pconnect function does not exist, is interbase extension installed?';
             return $this->sql_error('');
         }
         $this->db_connect_id = @ibase_pconnect($use_database, $this->user, $sqlpassword, false, false, 3);
     } else {
         if (!function_exists('ibase_connect')) {
             $this->connect_error = 'ibase_connect function does not exist, is interbase extension installed?';
             return $this->sql_error('');
         }
         $this->db_connect_id = @ibase_connect($use_database, $this->user, $sqlpassword, false, false, 3);
     }
     // Do not call ibase_service_attach if connection failed,
     // otherwise error message from ibase_(p)connect call will be clobbered.
     if ($this->db_connect_id && function_exists('ibase_service_attach') && $this->server) {
         $this->service_handle = @ibase_service_attach($this->server, $this->user, $sqlpassword);
     } else {
         $this->service_handle = false;
     }
     return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
 }
开发者ID:ahmatjan,项目名称:Crimson,代码行数:41,代码来源:firebird.php

示例8: _connect

 /**
  * @brief DB 접속
  **/
 function _connect()
 {
     // db 정보가 없으면 무시
     if (!$this->hostname || !$this->port || !$this->userid || !$this->password || !$this->database) {
         return;
     }
     //if(strpos($this->hostname, ':')===false && $this->port) $this->hostname .= ':'.$this->port;
     // 접속시도
     $host = $this->hostname . "/" . $this->port . ":" . $this->database;
     $this->fd = @ibase_connect($host, $this->userid, $this->password);
     if (ibase_errmsg()) {
         $this->setError(ibase_errcode(), ibase_errmsg());
         return $this->is_connected = false;
     }
     // Firebird 버전 확인후 2.0 이하면 오류 표시
     if (($service = ibase_service_attach($this->hostname, $this->userid, $this->password)) != FALSE) {
         // get server version and implementation strings
         $server_info = ibase_server_info($service, IBASE_SVC_SERVER_VERSION);
         ibase_service_detach($service);
     } else {
         $this->setError(ibase_errcode(), ibase_errmsg());
         @ibase_close($this->fd);
         return $this->is_connected = false;
     }
     $pos = strpos($server_info, "Firebird");
     if ($pos !== false) {
         $ver = substr($server_info, $pos + strlen("Firebird"));
         $ver = trim($ver);
     }
     if ($ver < "2.0") {
         $this->setError(-1, "XE cannot be installed under the version of firebird 2.0. Current firebird version is " . $ver);
         @ibase_close($this->fd);
         return $this->is_connected = false;
     }
     // 접속체크
     $this->is_connected = true;
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:40,代码来源:DBFirebird.class.php

示例9: getServerVersion

 /**
  * return version information about the server
  *
  * @param bool   $native  determines if the raw version string should be returned
  * @return mixed array/string with version information or MDB2 error object
  * @access public
  */
 function getServerVersion($native = false)
 {
     $server_info = false;
     if ($this->connected_server_info) {
         $server_info = $this->connected_server_info;
     } elseif ($this->options['server_version']) {
         $server_info = $this->options['server_version'];
     } else {
         $username = $this->options['DBA_username'] ? $this->options['DBA_username'] : $this->dsn['username'];
         $password = $this->options['DBA_password'] ? $this->options['DBA_password'] : $this->dsn['password'];
         $ibserv = @ibase_service_attach($this->dsn['hostspec'], $username, $password);
         $server_info = @ibase_server_info($ibserv, IBASE_SVC_SERVER_VERSION);
         @ibase_service_detach($ibserv);
     }
     if (!$server_info) {
         return $this->raiseError(MDB2_ERROR_UNSUPPORTED, null, null, 'Requires either "server_version" or "DBA_username"/"DBA_password" option', __FUNCTION__);
     }
     // cache server_info
     $this->connected_server_info = $server_info;
     if (!$native) {
         //WI-V1.5.3.4854 Firebird 1.5
         //WI-T2.1.0.16780 Firebird 2.1 Beta 2
         if (!preg_match('/-[VT]([\\d\\.]*)/', $server_info, $matches)) {
             return $this->raiseError(MDB2_ERROR_INVALID, null, null, 'Could not parse version information:' . $server_info, __FUNCTION__);
         }
         $tmp = explode('.', $matches[1], 4);
         $server_info = array('major' => isset($tmp[0]) ? $tmp[0] : null, 'minor' => isset($tmp[1]) ? $tmp[1] : null, 'patch' => isset($tmp[2]) ? $tmp[2] : null, 'extra' => isset($tmp[3]) ? $tmp[3] : null, 'native' => $server_info);
     }
     return $server_info;
 }
开发者ID:Dulciane,项目名称:jaws,代码行数:37,代码来源:ibase.php

示例10: _version

 /**
  * Version number query string
  *
  * @access  public
  * @return  string
  */
 function _version()
 {
     if (($svc = ibase_service_attach($this->hostname, $this->username, $this->password)) != FALSE) {
         $ibase_info = ibase_server_info($svc, IBASE_SVC_SERVER_VERSION) . '/' . ibase_server_info($svc, IBASE_SVC_IMPLEMENTATION);
         ibase_service_detach($svc);
     } else {
         $ibase_info = 'Unable to Determine';
     }
     return $ibase_info;
 }
开发者ID:ibnoe,项目名称:simpatda-thinkfrogs,代码行数:16,代码来源:ibase_driver.php

示例11: getServerVersion

 /**
  * Retrieve server version in PHP style
  *
  * @return string
  */
 public function getServerVersion()
 {
     $this->_connect();
     $service = ibase_service_attach($this->_formatDbConnString($this->_config['host'], $this->_config['port'], ''), $this->_config['username'], $this->_config['password']);
     if ($service != FALSE) {
         $server_info = ibase_server_info($service, IBASE_SVC_SERVER_VERSION);
         ibase_service_detach($service);
         $matches = null;
         if (preg_match('/((?:[0-9]{1,2}\\.){1,3}[0-9]{1,2})/', $server_info, $matches)) {
             return $matches[1];
         } else {
             return null;
         }
     } else {
         return null;
     }
 }
开发者ID:2085020,项目名称:zendframework1,代码行数:22,代码来源:Firebird.php

示例12: backup

 public function backup($filename = '')
 {
     if ($service = ibase_service_attach($this->config['host'], $this->config['user'], $this->config['password'])) {
         $backup = ibase_backup($service, $this->config['database'], $filename . '.fbk');
         ibase_service_detach($service);
         return $backup;
     }
     return false;
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:9,代码来源:Ibase.php


注:本文中的ibase_service_attach函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。