@@ -77,7 +77,7 @@ public static function dumpResult(Result $result): void
7777 /**
7878 * Returns syntax highlighted SQL command.
7979 */
80- public static function dumpSql (SqlLiteral $ query , ?Connection $ connection = null ): string
80+ public static function dumpSql (SqlLiteral $ query , ?Explorer $ explorer = null ): string
8181 {
8282 $ 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 ' ;
8383 $ keywords2 = 'ALL|DISTINCT|DISTINCTROW|IGNORE|AS|USING|ON|AND|OR|IN|IS|NOT|NULL|[RI]?LIKE|REGEXP|TRUE|FALSE ' ;
@@ -112,7 +112,7 @@ public static function dumpSql(SqlLiteral $query, ?Connection $connection = null
112112
113113 // parameters
114114 $ params = $ query ->getParameters ();
115- $ sql = preg_replace_callback ('#\?# ' , function () use ($ params , $ connection ): string {
115+ $ sql = preg_replace_callback ('#\?# ' , function () use ($ params , $ explorer ): string {
116116 static $ i = 0 ;
117117 $ param = $ params [$ i ++] ?? null ;
118118 if ($ param === null ) {
@@ -130,7 +130,7 @@ public static function dumpSql(SqlLiteral $query, ?Connection $connection = null
130130 } elseif (is_string ($ param )) {
131131 $ length = Nette \Utils \Strings::length ($ param );
132132 $ truncated = Nette \Utils \Strings::truncate ($ param , self ::$ maxLength );
133- $ text = htmlspecialchars ($ connection ? $ connection ->quote ($ truncated ) : '\'' . $ truncated . '\'' , ENT_NOQUOTES , 'UTF-8 ' );
133+ $ text = htmlspecialchars ($ explorer ? $ explorer ->quote ($ truncated ) : '\'' . $ truncated . '\'' , ENT_NOQUOTES , 'UTF-8 ' );
134134 return '<span title="Length ' . $ length . ' characters"> ' . $ text . '</span> ' ;
135135
136136 } elseif (is_resource ($ param )) {
@@ -160,7 +160,7 @@ public static function dumpSql(SqlLiteral $query, ?Connection $connection = null
160160 * @return int Number of executed commands
161161 * @throws Nette\FileNotFoundException
162162 */
163- public static function loadFromFile (Connection $ connection , string $ file , ?callable $ onProgress = null ): int
163+ public static function loadFromFile (Explorer $ explorer , string $ file , ?callable $ onProgress = null ): int
164164 {
165165 @set_time_limit (0 ); // @ function may be disabled
166166
@@ -173,7 +173,7 @@ public static function loadFromFile(Connection $connection, string $file, ?calla
173173 $ count = $ size = 0 ;
174174 $ delimiter = '; ' ;
175175 $ sql = '' ;
176- $ connection = $ connection ->getConnection (); // native query without logging
176+ $ connection = $ explorer ->getConnection (); // native query without logging
177177 while (($ s = fgets ($ handle )) !== false ) {
178178 $ size += strlen ($ s );
179179 if (!strncasecmp ($ s , 'DELIMITER ' , 10 )) {
@@ -207,7 +207,7 @@ public static function loadFromFile(Connection $connection, string $file, ?calla
207207
208208 /** @deprecated use Nette\Bridges\DatabaseTracy\ConnectionPanel::initialize() */
209209 public static function createDebugPanel (
210- Connection $ connection ,
210+ Explorer $ connection ,
211211 bool $ explain ,
212212 string $ name ,
213213 Tracy \Bar $ bar ,
@@ -221,7 +221,7 @@ public static function createDebugPanel(
221221
222222 /** @deprecated use Nette\Bridges\DatabaseTracy\ConnectionPanel::initialize() */
223223 public static function initializeTracy (
224- Connection $ connection ,
224+ Explorer $ connection ,
225225 bool $ addBarPanel = false ,
226226 string $ name = '' ,
227227 bool $ explain = true ,
0 commit comments