Skip to content
Snippets Groups Projects
Select Git revision
  • 3eeac9d027ad23bf13d9a56539455cb4dd5f8020
  • main default protected
  • rosification
  • refactoring
  • pp
  • mpc
  • realtimelogplotter
  • alv
  • gitlab_ci_podman
  • restructuring
  • viz_fix
11 results

measuring_stick.py

Blame
  • class.AddressDB.php 908 B
    <?php
    
    class AddressDB {
      private static $instance;
      private $PDB;
      private $database = 'NyAdresser';
     
      private function __construct() {
        global $gCms;
        if (!isset($gCms)) exit;
        $config =& $gCms->GetConfig();
        $this->PDB = ADONewConnection($config['dbms'],
                                      'pear:date:extend:transaction');
        $result = $this->PDB->Connect($config['db_hostname'],
                                      $config['db_username'],
                                      $config['db_password'],
                                      $this->database);
        if ($result) {
          $result = $this->PDB->Execute("SET NAMES 'utf8'");
        } else {
          echo "Database error!<br>" . $this->PDB->ErrorMsg();
          exit;
        }
      }
    
      public static function getDB() {
        if (!isset(self::$instance)) {
          $c = __CLASS__;
          self::$instance = new $c;
        }
        return self::$instance->PDB;
      }
    }