@@ -75,7 +75,7 @@ public static function dumpResult(Result $result): void
7575 /**
7676 * Returns syntax highlighted SQL command.
7777 */
78- public static function dumpSql (SqlLiteral $ query , ?Connection $ connection = null ): string
78+ public static function dumpSql (SqlLiteral $ query , ?Explorer $ explorer = null ): string
7979 {
8080 $ keywords1 = 'SELECT|(?:ON\s+DUPLICATE\s+KEY)?UPDATE|INSERT(?:\s+INTO)?|REPLACE(?:\s+INTO)?|DELETE|CALL|UNION|FROM|WHERE|HAVING|GROUP\s+BY|ORDER\s+BY|LIMIT|OFFSET|SET|VALUES|LEFT\s+JOIN|INNER\s+JOIN|TRUNCATE ' ;
8181 $ keywords2 = 'ALL|DISTINCT|DISTINCTROW|IGNORE|AS|USING|ON|AND|OR|IN|IS|NOT|NULL|[RI]?LIKE|REGEXP|TRUE|FALSE ' ;
@@ -110,7 +110,7 @@ public static function dumpSql(SqlLiteral $query, ?Connection $connection = null
110110
111111 // parameters
112112 $ params = $ query ->getParameters ();
113- $ sql = preg_replace_callback ('#\?# ' , function () use ($ params , $ connection ): string {
113+ $ sql = preg_replace_callback ('#\?# ' , function () use ($ params , $ explorer ): string {
114114 static $ i = 0 ;
115115 $ param = $ params [$ i ++] ?? null ;
116116 if ($ param === null ) {
@@ -128,7 +128,7 @@ public static function dumpSql(SqlLiteral $query, ?Connection $connection = null
128128 } elseif (is_string ($ param )) {
129129 $ length = Nette \Utils \Strings::length ($ param );
130130 $ truncated = Nette \Utils \Strings::truncate ($ param , self ::$ maxLength );
131- $ text = htmlspecialchars ($ connection ? $ connection ->quote ($ truncated ) : '\'' . $ truncated . '\'' , ENT_NOQUOTES , 'UTF-8 ' );
131+ $ text = htmlspecialchars ($ explorer ? $ explorer ->quote ($ truncated ) : '\'' . $ truncated . '\'' , ENT_NOQUOTES , 'UTF-8 ' );
132132 return '<span title="Length ' . $ length . ' characters"> ' . $ text . '</span> ' ;
133133
134134 } elseif (is_resource ($ param )) {
@@ -157,7 +157,7 @@ public static function dumpSql(SqlLiteral $query, ?Connection $connection = null
157157 * @param ?array<callable(int, ?float): void> $onProgress
158158 * @return int count of commands
159159 */
160- public static function loadFromFile (Connection $ connection , string $ file , ?callable $ onProgress = null ): int
160+ public static function loadFromFile (Explorer $ explorer , string $ file , ?callable $ onProgress = null ): int
161161 {
162162 @set_time_limit (0 ); // @ function may be disabled
163163
@@ -170,7 +170,7 @@ public static function loadFromFile(Connection $connection, string $file, ?calla
170170 $ count = $ size = 0 ;
171171 $ delimiter = '; ' ;
172172 $ sql = '' ;
173- $ connection = $ connection ->getConnection (); // native query without logging
173+ $ connection = $ explorer ->getConnection (); // native query without logging
174174 while (($ s = fgets ($ handle )) !== false ) {
175175 $ size += strlen ($ s );
176176 if (!strncasecmp ($ s , 'DELIMITER ' , 10 )) {
@@ -204,7 +204,7 @@ public static function loadFromFile(Connection $connection, string $file, ?calla
204204
205205 /** @deprecated use Nette\Bridges\DatabaseTracy\ConnectionPanel::initialize() */
206206 public static function createDebugPanel (
207- Connection $ connection ,
207+ Explorer $ connection ,
208208 bool $ explain ,
209209 string $ name ,
210210 Tracy \Bar $ bar ,
@@ -218,7 +218,7 @@ public static function createDebugPanel(
218218
219219 /** @deprecated use Nette\Bridges\DatabaseTracy\ConnectionPanel::initialize() */
220220 public static function initializeTracy (
221- Connection $ connection ,
221+ Explorer $ connection ,
222222 bool $ addBarPanel = false ,
223223 string $ name = '' ,
224224 bool $ explain = true ,
0 commit comments