@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | private function slowParser() |
| 134 | 134 | { |
| 135 | 135 | $dataBase = new DataBase(); |
| 136 | - $sqlDelete = "DELETE FROM " . $this->tableName() . ";"; |
|
| 136 | + $sqlDelete = "DELETE FROM ".$this->tableName().";"; |
|
| 137 | 137 | $dataBase->exec($sqlDelete); |
| 138 | 138 | |
| 139 | 139 | [$handle, $totalLines] = $this->utf8FopenRead($this->fileNameTxt); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | while (($raw_string = fgets($handle)) !== false) { |
| 143 | 143 | $totalLines--; |
| 144 | 144 | if ($maxLine === 2000) { |
| 145 | - $query = 'INSERT INTO ' . $this->tableName() . |
|
| 145 | + $query = 'INSERT INTO '.$this->tableName(). |
|
| 146 | 146 | ' (rnc, nombre, razonsocial, categoria, inicioactividad, estado, regimenpagos) VALUES '; |
| 147 | 147 | } |
| 148 | 148 | $linea = str_getcsv($raw_string, "|"); |
@@ -172,14 +172,14 @@ discard block |
||
| 172 | 172 | $fecha = ($colArray[8] === '00/00/0000') |
| 173 | 173 | ? "2000-01-01" |
| 174 | 174 | : \date('Y-m-d', strtotime(str_replace("/", "-", $colArray[8]))); |
| 175 | - return "('" . |
|
| 176 | - $colArray[0] . "','" . |
|
| 177 | - str_replace('\\', '', str_replace('"', '', str_replace("'", "''", str_replace(" ", " ", $colArray[1])))) . "','" . |
|
| 178 | - str_replace('\\', '', str_replace('"', '', str_replace("'", "''", str_replace(" ", " ", $colArray[2])))) . "','" . |
|
| 179 | - $colArray[3] . "','" . |
|
| 180 | - $fecha . "','" . |
|
| 181 | - $colArray[9] . "','" . |
|
| 182 | - $colArray[10] . "')" . $semiColon; |
|
| 175 | + return "('". |
|
| 176 | + $colArray[0]."','". |
|
| 177 | + str_replace('\\', '', str_replace('"', '', str_replace("'", "''", str_replace(" ", " ", $colArray[1]))))."','". |
|
| 178 | + str_replace('\\', '', str_replace('"', '', str_replace("'", "''", str_replace(" ", " ", $colArray[2]))))."','". |
|
| 179 | + $colArray[3]."','". |
|
| 180 | + $fecha."','". |
|
| 181 | + $colArray[9]."','". |
|
| 182 | + $colArray[10]."')".$semiColon; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | private function utf8FopenRead($fileName) |