public function Init($Config = NULL) {
      if(is_null($Config))
         $Config = Gdn::Config('Database');
      elseif(is_string($Config))
         $Config = Gdn::Config($Config);
      
      $DefaultConfig = Gdn::Config('Database');
      if (is_null($Config))
         $Config = array();
      if (is_null($DefaultConfig))
         $DefaultConfig = array();
         
      $this->Engine = ArrayValue('Engine', $Config, $DefaultConfig['Engine']);
      $this->User = ArrayValue('User', $Config, $DefaultConfig['User']);
      $this->Password = ArrayValue('Password', $Config, $DefaultConfig['Password']);
      $this->ConnectionOptions = ArrayValue('ConnectionOptions', $Config, $DefaultConfig['ConnectionOptions']);
      $this->DatabasePrefix = ArrayValue('DatabasePrefix', $Config, ArrayValue('Prefix', $Config, $DefaultConfig['DatabasePrefix']));
      $this->ExtendedProperties = ArrayValue('ExtendedProperties', $Config, array());
      
      if (array_key_exists('Dsn', $Config)) {
         // Get the dsn from the property.
         $Dsn = $Config['Dsn'];
      } else {   
         $Host = ArrayValue('Host', $Config, ArrayValue('Host', $DefaultConfig, ''));
         if(array_key_exists('Dbname', $Config))
            $Dbname = $Config['Dbname'];
         elseif(array_key_exists('Name', $Config))
            $Dbname = $Config['Name'];
         elseif(array_key_exists('Dbname', $DefaultConfig))
            $Dbname = $DefaultConfig['Dbname'];
         elseif(array_key_exists('Name', $DefaultConfig))
            $Dbname = $DefaultConfig['Name'];
         // Was the port explicitly defined in the config?
         $Port = ArrayValue('Port', $Config, ArrayValue('Port', $DefaultConfig, ''));
         
         if(!isset($Dbname)) {
            $Dsn = $DefaultConfig['Dsn'];
         } else {
            if(empty($Port)) {
               // Was the port explicitly defined with the host name? (ie. 127.0.0.1:3306)
               $Host = explode(':', $Host);
               $Port = count($Host) == 2 ? $Host[1] : '';
               $Host = $Host[0];
            }
            
            if(empty($Port)) {
               $Dsn = sprintf('host=%s;dbname=%s;', $Host, $Dbname);
            } else {
               $Dsn = sprintf('host=%s;port=%s;dbname=%s;', $Host, $Port, $Dbname);
            }
         }
      }
      
      $this->Dsn = $Dsn;
   }