本文整理汇总了PHP中ocilogon函数的典型用法代码示例。如果您正苦于以下问题:PHP ocilogon函数的具体用法?PHP ocilogon怎么用?PHP ocilogon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ocilogon函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: db_connect
/**
* Non-persistent database connection
*
* @access private called by the base class
* @return resource
*/
function db_connect()
{
// ====== Modificación por CRIE - UTP =======
// Se agrega el parámetro utf8 a la función ocilogon para
// forzar el uso de la codificación UTF-8 en Oracle
return @ocilogon($this->username, $this->password, $this->hostname, 'utf8');
// ========= Fin Modificación =========
}
示例2: connect
function connect($h, $u, $p)
{
$this->DBHost = $h;
$this->DBUser = $u;
$this->DBPassword = $p;
$this->connection = ocilogon($this->DBUser, $this->DBPassword, $this->DBHost);
return $this->connection;
}
示例3: phpOpenTracker_DB_oci8
/**
* Constructor.
*
* @access public
*/
function phpOpenTracker_DB_oci8()
{
$this->phpOpenTracker_DB();
$database = $this->config['db_database'] == 'default' ? '' : $this->config['db_database'];
$this->connection = @ocilogon($this->config['db_user'], $this->config['db_password'], $database);
if (!$this->connection) {
return phpOpenTracker::handleError('Could not connect to database.', E_USER_ERROR);
}
}
示例4: db_connect
/**
* Non-persistent database connection
*
* @access private called by the base class
* @return resource
*/
function db_connect()
{
// print_r("hostname ".$this->hostname);
// print_r("pooled ".$this->pooled);
// return @ocilogon($this->username, $this->password, $this->hostname);
$connection = ocilogon($this->username, $this->password, $this->pooled);
if (!$connection) {
$e = oci_error();
print_r("<b>Error In Connection:</b>" . $e['message']);
}
return @ocilogon($this->username, $this->password, $this->pooled);
}
示例5: oracle_login
function oracle_login($info, $serv_type)
{
$conn_str = '( DESCRIPTION =
( ADDRESS =
( PROTOCOL = TCP )
( HOST = ' . $info["HOST"] . ')
( PORT = ' . $info["PORT"] . ') )
( CONNECT_DATA =
( SERVICE_NAME = ' . $info["BASE"] . ')
( SERVER = ' . $serv_type . ') ) )';
$c = @ocilogon($info["USER"], $info["PASS"], $conn_str);
return $c;
}
示例6: da_sql_connect
function da_sql_connect($config)
{
if ($config[sql_use_http_credentials] == 'yes') {
global $HTTP_SERVER_VARS;
$SQL_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"];
$SQL_passwd = $HTTP_SERVER_VARS["PHP_AUTH_PW"];
} else {
$SQL_user = $config[sql_username];
$SQL_passwd = $config[sql_password];
}
$link = @ocilogon($SQL_user, $SQL_passwd, $config[sql_database]);
$res = @da_sql_query($link, $config, "ALTER SESSION SET NLS_TIMESTAMP_TZ_FORMAT='YYYY-MM-DD HH24:MI:SS.FF TZH:TZM'");
return $link;
}
示例7: Database
function Database($Server = 0)
{
global $DB;
settype($Server, "integer");
$this->DBName = $DB->Name($Server);
$this->DBPass = $DB->Pass($Server);
$this->DBUser = $DB->User($Server);
if (!isset($GLOBALS[md5($this->DBUser . $this->DBPass . $this->DBName)]) || !$GLOBALS[md5($this->DBUser . $this->DBPass . $this->DBName)]) {
$GLOBALS[md5($this->DBUser . $this->DBPass . $this->DBName)] = @ocilogon($this->DBUser, $this->DBPass, $this->DBName);
}
$this->conn = $GLOBALS[md5($this->DBUser . $this->DBPass . $this->DBName)];
if (!$this->conn) {
$this->error($this->conn);
}
$this->version = @OCIServerVersion($this->conn);
}
示例8: Connect
function Connect()
{
if ($this->TYPE == 'oracle') {
if (!($this->LINK = @ocilogon($this->USER, $this->PASS, $this->SERVER))) {
return false;
}
} elseif ($this->TYPE == 'mysql') {
if (!($this->LINK = @mysql_connect($this->SERVER, $this->USER, $this->PASS))) {
return false;
}
if (!@mysql_select_db($this->DB)) {
return false;
}
}
return true;
}
示例9: 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;
$connect = $database;
// support for "easy connect naming"
if ($sqlserver !== '' && $sqlserver !== '/') {
if (substr($sqlserver, -1, 1) == '/') {
$sqlserver == substr($sqlserver, 0, -1);
}
$connect = $sqlserver . ($port ? ':' . $port : '') . '/' . $database;
}
$this->db_connect_id = $new_link ? @ocinlogon($this->user, $sqlpassword, $connect, 'UTF8') : ($this->persistency ? @ociplogon($this->user, $sqlpassword, $connect, 'UTF8') : @ocilogon($this->user, $sqlpassword, $connect, 'UTF8'));
return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
}
示例10: db_start
function db_start()
{
global $DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName, $DatabasePort, $DatabaseType;
switch ($DatabaseType) {
case 'oracle':
$connection = @ocilogon($DatabaseUsername, $DatabasePassword, $DatabaseServer);
break;
case 'postgres':
//if($DatabaseServer!='localhost') //use for windows
if ($DatabaseServer != 'host') {
//updated for linux
$connectstring = "host={$DatabaseServer} ";
}
if ($DatabasePort != '5432') {
$connectstring .= "port={$DatabasePort} ";
}
$connectstring .= "dbname={$DatabaseName} user={$DatabaseUsername}";
if (!empty($DatabasePassword)) {
$connectstring .= " password={$DatabasePassword}";
}
$connection = pg_connect($connectstring);
break;
case 'mysql':
$connection = mysql_connect($DatabaseServer, $DatabaseUsername, $DatabasePassword);
mysql_select_db($DatabaseName);
break;
}
// Error code for both.
if ($connection === false) {
switch ($DatabaseType) {
case 'oracle':
$errors = OciError();
$errormessage = $errors['message'];
break;
case 'postgres':
$errormessage = pg_last_error($connection);
break;
case 'mysql':
$errormessage = mysql_error($connection);
break;
}
db_show_error("", "Could not Connect to Database: {$DatabaseServer}", $errstring);
}
return $connection;
}
示例11: db_start
function db_start()
{
global $DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName, $DatabasePort, $DatabaseType;
switch ($DatabaseType) {
case 'oracle':
$connection = @ocilogon($DatabaseUsername, $DatabasePassword, $DatabaseServer);
break;
case 'postgres':
if ($DatabaseServer != 'localhost') {
$connectstring = "host={$DatabaseServer} ";
}
if ($DatabasePort != '5432') {
$connectstring .= "port={$DatabasePort} ";
}
$connectstring .= "dbname={$DatabaseName} user={$DatabaseUsername}";
if (!empty($DatabasePassword)) {
$connectstring .= " password={$DatabasePassword}";
}
$connection = pg_connect($connectstring);
break;
case 'mysql':
$connection = mysql_connect($DatabaseServer, $DatabaseUsername, $DatabasePassword);
mysql_select_db($DatabaseName);
break;
}
// Error code for both.
if ($connection === false) {
switch ($DatabaseType) {
case 'oracle':
$errors = OciError();
$errormessage = $errors['message'];
break;
case 'postgres':
$errormessage = pg_last_error($connection);
break;
case 'mysql':
$errormessage = mysql_error($connection);
break;
}
// TRANSLATION: do NOT translate these since error messages need to stay in English for technical support
db_show_error("", sprintf('Could not Connect to Database Server \'%s\'', $DatabaseServer), $errstring);
}
return $connection;
}
示例12: connect
function connect()
{
if (strtoupper($this->dbType) != "OCI8") {
return false;
}
if ($this->isConnect) {
return true;
}
if ($this->_sid == "") {
$this->connection = ocilogon(parent::getUser(), parent::getPassword());
} else {
$this->connection = ocilogon(parent::getUser(), parent::getPassword(), $this->getSID());
}
if (!$this->connection) {
$this->isConnect = false;
} else {
$this->isConnect = true;
}
return $this->isConnect;
}
示例13: sql_connect
/**
* {@inheritDoc}
*/
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;
$connect = $database;
// support for "easy connect naming"
if ($sqlserver !== '' && $sqlserver !== '/') {
if (substr($sqlserver, -1, 1) == '/') {
$sqlserver == substr($sqlserver, 0, -1);
}
$connect = $sqlserver . ($port ? ':' . $port : '') . '/' . $database;
}
if ($new_link) {
if (!function_exists('ocinlogon')) {
$this->connect_error = 'ocinlogon function does not exist, is oci extension installed?';
return $this->sql_error('');
}
$this->db_connect_id = @ocinlogon($this->user, $sqlpassword, $connect, 'UTF8');
} else {
if ($this->persistency) {
if (!function_exists('ociplogon')) {
$this->connect_error = 'ociplogon function does not exist, is oci extension installed?';
return $this->sql_error('');
}
$this->db_connect_id = @ociplogon($this->user, $sqlpassword, $connect, 'UTF8');
} else {
if (!function_exists('ocilogon')) {
$this->connect_error = 'ocilogon function does not exist, is oci extension installed?';
return $this->sql_error('');
}
$this->db_connect_id = @ocilogon($this->user, $sqlpassword, $connect, 'UTF8');
}
}
return $this->db_connect_id ? $this->db_connect_id : $this->sql_error('');
}
示例14: connect
function connect($dsn = false)
{
$this->lasterr = null;
$this->lasterrcode = null;
if ($this->conn && $dsn == false) {
return true;
}
if (!$dsn) {
$dsn = $this->dsn;
} else {
$this->dsn = $dsn;
}
if (isset($dsn['charset']) && $dsn['charset'] != '') {
$charset = $dsn['charset'];
} else {
$charset = FLEA::getAppInf('databaseCharset');
}
if (strtoupper($charset) == 'GB2312') {
$charset = 'GBK';
}
if (empty($dsn['database'])) {
$dsn['database'] = null;
}
if ($charset != '') {
$this->conn = ocilogon("{$dsn['login']}", $dsn['password'], $dsn['database'], $charset);
} else {
$this->conn = ocilogon($dsn['login'], $dsn['password'], $dsn['database']);
}
if (!$this->conn) {
FLEA::loadClass('FLEA_Db_Exception_SqlQuery');
$err = ocierror();
__THROW(new FLEA_Db_Exception_SqlQuery("ocilogon('{$dsn['login']}') failed.", $err['message'], $err['code']));
return false;
}
$this->execute("ALTER SESSION SET NLS_DATE_FORMAT = '{$this->NLS_DATE_FORMAT}'");
return true;
}
示例15: ocilogon
<?php
$Conn = ocilogon($dbuser, $dbpass, $hostname, $encode);
?>