File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -193,21 +193,21 @@ public static function loadFromFile(Connection $connection, $file): int
193193 $ sql = '' ;
194194 $ pdo = $ connection ->getPdo (); // native query without logging
195195 while (!feof ($ handle )) {
196- $ s = rtrim (( string ) fgets ($ handle) );
196+ $ s = ( string ) fgets ($ handle );
197197 if (!strncasecmp ($ s , 'DELIMITER ' , 10 )) {
198- $ delimiter = substr ($ s , 10 );
198+ $ delimiter = trim ( substr ($ s , 10 ) );
199199
200- } elseif (substr ($ s , -strlen ($ delimiter )) === $ delimiter ) {
201- $ sql .= substr ($ s , 0 , -strlen ($ delimiter ));
200+ } elseif (substr ($ ts = rtrim ( $ s ) , -strlen ($ delimiter )) === $ delimiter ) {
201+ $ sql .= substr ($ ts , 0 , -strlen ($ delimiter ));
202202 $ pdo ->exec ($ sql );
203203 $ sql = '' ;
204204 $ count ++;
205205
206206 } else {
207- $ sql .= $ s . "\n" ;
207+ $ sql .= $ s ;
208208 }
209209 }
210- if (trim ($ sql ) !== '' ) {
210+ if (rtrim ($ sql ) !== '' ) {
211211 $ pdo ->exec ($ sql );
212212 $ count ++;
213213 }
You can’t perform that action at this time.
0 commit comments