File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -529,7 +529,7 @@ private function readSql($databaseKey = null, $databaseConfig = null): void
529
529
}
530
530
531
531
/**
532
- * @throws ModuleConfigException
532
+ * @throws ModuleConfigException|ModuleException
533
533
*/
534
534
private function readSqlFile (string $ filePath ): ?string
535
535
{
@@ -545,7 +545,16 @@ private function readSqlFile(string $filePath): ?string
545
545
$ sql = file_get_contents (Configuration::projectDir () . $ filePath );
546
546
547
547
// remove C-style comments (except MySQL directives)
548
- return preg_replace ('#/\*(?!!\d+).*?\*/#s ' , '' , $ sql );
548
+ $ replaced = preg_replace ('#/\*(?!!\d+).*?\*/#s ' , '' , $ sql );
549
+
550
+ if (!empty ($ sql ) && is_null ($ replaced )) {
551
+ throw new ModuleException (
552
+ __CLASS__ ,
553
+ "Please, increase pcre.backtrack_limit value in PHP CLI config "
554
+ );
555
+ }
556
+
557
+ return $ replaced ;
549
558
}
550
559
551
560
private function connect ($ databaseKey , $ databaseConfig ): void
You can’t perform that action at this time.
0 commit comments