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
193
193
$ sql = '' ;
194
194
$ pdo = $ connection ->getPdo (); // native query without logging
195
195
while (!feof ($ handle )) {
196
- $ s = rtrim (( string ) fgets ($ handle) );
196
+ $ s = ( string ) fgets ($ handle );
197
197
if (!strncasecmp ($ s , 'DELIMITER ' , 10 )) {
198
- $ delimiter = substr ($ s , 10 );
198
+ $ delimiter = trim ( substr ($ s , 10 ) );
199
199
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 ));
202
202
$ pdo ->exec ($ sql );
203
203
$ sql = '' ;
204
204
$ count ++;
205
205
206
206
} else {
207
- $ sql .= $ s . "\n" ;
207
+ $ sql .= $ s ;
208
208
}
209
209
}
210
- if (trim ($ sql ) !== '' ) {
210
+ if (rtrim ($ sql ) !== '' ) {
211
211
$ pdo ->exec ($ sql );
212
212
$ count ++;
213
213
}
You can’t perform that action at this time.
0 commit comments