Exemple #1
0
     // array name file to import
     foreach ($aInfoImport as $item) {
         $importFile = $root . "/" . strtolower($item['file_name']);
         if (file_exists($importFile)) {
             $aExists = array();
             $aNew = array();
             $aData = file($importFile, FILE_IGNORE_NEW_LINES);
             $this->HandleImport($item['ClassName'], $item['FieldName'], $aData, $aExists, $aNew);
             $this->InsertNewRecord($item['ClassName'], $item['FieldName'], $aNew);
         }
     }
     //        ApiPostcode::HandleUpdateLonLatTableBuilding(); // only run from cron job
     $to = time();
     $second = $to - $from;
     echo ' done in: ' . $second . '  Second  <=> ' . $second / 60 . ' Minutes';
     die;
 }
 /**
  * @Author: ANH DUNG Mar 19, 2015
  * @Todo: Handle Import file, belong to actionImportApi
  * @Param: $ClassName name of model
  * @Param: $field_name field in db
  * @Param: $aData array data from file
  */
 public function HandleImport($ClassName, $FieldName, $aData, &$aExists, &$aNew)
 {
     foreach ($aData as $row) {
         $aNew[] = MyFormat::escapeValues($row);
     }
     // thêm mới toàn bộ
Exemple #2
0
 public function run($args)
 {
     $m = new ListingSynchronizer();
     $m->run();
 }