Exemplo n.º 1
0
 function connect($Database = "", $Host = "", $User = "", $Password = "")
 {
     /* Handle defaults */
     if ("" == $Database) {
         $Database = $this->Database;
     }
     if ("" == $Host) {
         $Host = $this->Host;
     }
     if ("" == $User) {
         $User = $this->User;
     }
     if ("" == $Password) {
         $Password = $this->Password;
     }
     # Ben Drushell - added Oci8PutEnv for consistancy with db_oracle
     if ($this->Oci8PutEnv) {
         PutEnv("ORACLE_SID={$this->Database}");
         PutEnv("ORACLE_HOME={$this->Host}");
     }
     if (0 == $this->Link_ID) {
         if ($this->Debug) {
             printf("<br>Connecting to {$this->Database}...<br>\n");
         }
         $this->Link_ID = OCIplogon("{$this->User}", "{$this->Password}", "{$this->Database}");
         if (!$this->Link_ID) {
             $this->halt("Link-ID == false " . "({$this->Link_ID}), OCILogon failed");
         }
         if ($this->Debug) {
             printf("<br>Obtained the Link_ID: {$this->Link_ID}<br>\n");
         }
     }
     return $this->Link_ID;
 }
Exemplo n.º 2
0
    This source code is released under the GNU General Public License version 2, unless otherwise agreed with openQRM Enterprise GmbH.
    The latest version of this license can be found here: src/doc/LICENSE.txt

    By using this software, you acknowledge having read this license and agree to be bound thereby.

                http://openqrm-enterprise.com

    Copyright 2014, openQRM Enterprise GmbH <*****@*****.**>
*/
$RootDir = $_SERVER["DOCUMENT_ROOT"] . '/openqrm/base/';
require_once $RootDir . 'include/openqrm-server-config.php';
if (isset($OPENQRM_ORACLE_HOME)) {
    PutEnv("LD_LIBRARY_PATH={$OPENQRM_LD_LIBRARY_PATH}");
    PutEnv("ORACLE_HOME={$OPENQRM_ORACLE_HOME}");
    PutEnv("TNS_ADMIN={$OPENQRM_TNS_ADMIN}");
}
if (!defined("ADODB_ASSOC_CASE")) {
    define('ADODB_ASSOC_CASE', 0);
}
// different locations of adodb for suse/redhat/debian
if (file_exists('/usr/share/php/adodb/adodb.inc.php')) {
    require_once '/usr/share/php/adodb/adodb.inc.php';
} else {
    if (file_exists($RootDir . 'include/adodb/adodb.inc.php')) {
        require_once $RootDir . 'include/adodb/adodb.inc.php';
    } else {
        if (file_exists('/usr/share/adodb/adodb.inc.php')) {
            require_once '/usr/share/adodb/adodb.inc.php';
        } else {
            echo 'ERROR: Could not find adodb on this system!';