@@ -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 )) {
@@ -158,7 +158,7 @@ public static function dumpSql(SqlLiteral $query, ?Connection $connection = null
158158 * @return int Number of executed commands
159159 * @throws Nette\FileNotFoundException
160160 */
161- public static function loadFromFile (Connection $ connection , string $ file , ?callable $ onProgress = null ): int
161+ public static function loadFromFile (Explorer $ explorer , string $ file , ?callable $ onProgress = null ): int
162162 {
163163 @set_time_limit (0 ); // @ function may be disabled
164164
@@ -171,7 +171,7 @@ public static function loadFromFile(Connection $connection, string $file, ?calla
171171 $ count = $ size = 0 ;
172172 $ delimiter = '; ' ;
173173 $ sql = '' ;
174- $ connection = $ connection ->getConnection (); // native query without logging
174+ $ connection = $ explorer ->getConnection (); // native query without logging
175175 while (($ s = fgets ($ handle )) !== false ) {
176176 $ size += strlen ($ s );
177177 if (!strncasecmp ($ s , 'DELIMITER ' , 10 )) {
@@ -205,7 +205,7 @@ public static function loadFromFile(Connection $connection, string $file, ?calla
205205
206206 /** @deprecated use Nette\Bridges\DatabaseTracy\ConnectionPanel::initialize() */
207207 public static function createDebugPanel (
208- Connection $ connection ,
208+ Explorer $ connection ,
209209 bool $ explain ,
210210 string $ name ,
211211 Tracy \Bar $ bar ,
@@ -219,7 +219,7 @@ public static function createDebugPanel(
219219
220220 /** @deprecated use Nette\Bridges\DatabaseTracy\ConnectionPanel::initialize() */
221221 public static function initializeTracy (
222- Connection $ connection ,
222+ Explorer $ connection ,
223223 bool $ addBarPanel = false ,
224224 string $ name = '' ,
225225 bool $ explain = true ,
0 commit comments