Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, October 15, 2026

Diff for scripts/php/sk-nic/SK-NIC.php between version 1.2 and 1.3

version 1.2, 2007/03/11 03:54:40 version 1.3, 2007/03/12 03:50:10
Line 13 
Line 13 
  *   *
  */   */
   
 /* $Platon: scripts/php/sk-nic/SK-NIC.php,v 1.1 2007-03-11 03:49:48 nepto Exp $ */  /* $Platon: scripts/php/sk-nic/SK-NIC.php,v 1.2 2007-03-11 03:54:40 nepto Exp $ */
   
 require_once 'DB.php';  require_once 'DB.php';
   
 class SK_NIC  class SK_NIC
 {  {
           var $input_dt_format_sql = '%d.%m.%Y';
         var $_dsn  = null;          var $_dsn  = null;
         var $_db   = null;          var $_db   = null;
   
Line 80  class SK_NIC
Line 81  class SK_NIC
                         $changed_date = $this->_getChangedDateFromFilename($filename);                          $changed_date = $this->_getChangedDateFromFilename($filename);
                 }                  }
                 $this->_cleanImport();                  $this->_cleanImport();
                 $this->_writeImport($filename, $changed_date);                  $this->_writeImportWithLoadData($filename, $changed_date);
         } /* }}} */          } /* }}} */
   
         function _cleanImport() /* {{{ */          function _cleanImport() /* {{{ */
Line 89  class SK_NIC
Line 90  class SK_NIC
                 DB::isError($result) && $this->error($result);                  DB::isError($result) && $this->error($result);
         } /* }}} */          } /* }}} */
   
         function _writeImport($filename, $changed_date) /* {{{ */          function _writeImportWithInserts($filename, $changed_date) /* {{{ */
         {          {
                 if (($f = fopen($filename, 'r')) == false) {                  if (($f = fopen($filename, 'r')) == false) {
                         $this->error('unable to open: '.$filename);                          $this->error('unable to open: '.$filename);
Line 128  class SK_NIC
Line 129  class SK_NIC
                 fclose($f);                  fclose($f);
         } /* }}} */          } /* }}} */
   
           function _writeImportWithLoadData($filename, $changed_date) /* {{{ */
           {
                   $query = sprintf('load data local infile %s'
                                   .' into table sknic_domains_import'
                                   .' fields terminated by ";"'
                                   .' ignore 11 lines'
                                   .' (domain,id_reg,id_owner,flag,status,ns1,ns2,ns3,ns4,ico_owner,@dt_valid)'
                                   .' SET dt_valid = STR_TO_DATE(@dt_valid, %s), dt_changed = %s',
                                   $this->_db->quote($filename),
                                   $this->_db->quote($this->input_dt_format_sql),
                                   $this->_db->quote($changed_date));
                   $result = $this->_db->query($query);
                   DB::isError($result) && $this->error($result);
           } /* }}} */
   
         function _writeDomainHistory($rec, $deleted = 0) /* {{{ */          function _writeDomainHistory($rec, $deleted = 0) /* {{{ */
         {          {
                 static $dt_deleted = null;                  static $dt_deleted = null;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top