Beispiel #1
0
 function __construct()
 {
     // Load Configuration for this Module
     global $configArray;
     $this->hipUrl = $configArray['Catalog']['hipUrl'];
     $this->hipProfile = $configArray['Catalog']['hipProfile'];
     $this->selfRegProfile = $configArray['Catalog']['selfRegProfile'];
     // Connect to database
     if (!isset($configArray['Catalog']['useDb']) || $configArray['Catalog']['useDb'] == true) {
         try {
             if (strcasecmp($configArray['System']['operatingSystem'], 'windows') == 0) {
                 sybase_min_client_severity(11);
                 $this->db = @sybase_connect($configArray['Catalog']['database'], $configArray['Catalog']['username'], $configArray['Catalog']['password']);
             } else {
                 $this->db = mssql_connect($configArray['Catalog']['host'] . ':' . $configArray['Catalog']['port'], $configArray['Catalog']['username'], $configArray['Catalog']['password']);
                 // Select the database
                 mssql_select_db($configArray['Catalog']['database']);
             }
         } catch (Exception $e) {
             global $logger;
             $logger->log("Could not load Horizon database", PEAR_LOG_ERR);
         }
     } else {
         $this->useDb = false;
     }
 }
Beispiel #2
0
 /**
  * Constructor
  *
  * @return PMF_DB_Sybase
  */
 public function __construct()
 {
     if (function_exists('sybase_min_client_severity')) {
         sybase_min_client_severity(100);
     }
     if (function_exists('sybase_min_server_severity')) {
         sybase_min_server_severity(9);
     }
     if (function_exists('sybase_min_error_severity')) {
         sybase_min_error_severity(9);
     }
     if (function_exists('sybase_min_message_severity')) {
         sybase_min_message_severity(9);
     }
 }
<?php

ini_set('display_errors', true);
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);
require_once 'bootstrap.php';
global $configArray;
global $logger;
try {
    if (strcasecmp($configArray['System']['operatingSystem'], 'windows') == 0) {
        sybase_min_client_severity(11);
        $db = @sybase_connect($configArray['Catalog']['database'], $configArray['Catalog']['username'], $configArray['Catalog']['password']);
    } else {
        $db = mssql_connect($configArray['Catalog']['host'] . ':' . $configArray['Catalog']['port'], $configArray['Catalog']['username'], $configArray['Catalog']['password']);
        // Select the database
        mssql_select_db($configArray['Catalog']['database']);
    }
    echo "Connected to Horizon Database correctly";
} catch (Exception $e) {
    echo "Could not load Horizon database ";
    echo $e;
}