@@ -128,7 +128,7 @@ private function simplifyParams($params)
128128 private function parseSql ()
129129 {
130130 // Разбор многострочных комментариев
131- if (preg_match_all ('#/\*(\w +)(.+?)\*/#s ' , $ this ->sql , $ matches )) {
131+ if (preg_match_all ('#/\*([\w|] +)(.+?)\*/#s ' , $ this ->sql , $ matches )) {
132132 $ count = count ($ matches [0 ]);
133133 for ($ i = 0 ; $ i < $ count ; $ i ++) {
134134 $ this ->replaceComment ($ matches [0 ][$ i ], $ matches [2 ][$ i ], $ matches [1 ][$ i ]);
@@ -137,7 +137,7 @@ private function parseSql()
137137
138138 // Многоитерационный разбор однострчных комментариев
139139 while (true ) {
140- if (preg_match_all ('#--\*(\w +)(.+)# ' , $ this ->sql , $ matches )) {
140+ if (preg_match_all ('#--\*([\w|] +)(.+)# ' , $ this ->sql , $ matches )) {
141141 $ count = count ($ matches [0 ]);
142142 for ($ i = 0 ; $ i < $ count ; $ i ++) {
143143 $ this ->replaceComment ($ matches [0 ][$ i ], $ matches [2 ][$ i ], $ matches [1 ][$ i ]);
@@ -159,7 +159,21 @@ private function parseSql()
159159 private function replaceComment ($ comment , $ queryInComment , $ paramName )
160160 {
161161 $ param = $ this ->getParam ($ paramName );
162- if ($ param ) {
162+
163+ if (strpos ($ paramName , '| ' )) {
164+ $ found = false ;
165+
166+ foreach (explode ('| ' , $ paramName ) as $ param ) {
167+ if (array_key_exists ($ param , $ this ->params )) {
168+ $ found = true ;
169+ break ;
170+ }
171+ }
172+
173+ if (!$ found ) {
174+ $ queryInComment = '' ;
175+ }
176+ } elseif ($ param ) {
163177 $ paramName = $ param [0 ];
164178 $ paramValue = $ param [1 ];
165179 if (is_array ($ paramValue )) {
0 commit comments