From d95440f8b97b4359fd4545965c9d5845b4e77041 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 23 Jan 2017 14:38:36 +0100 Subject: [PATCH] Update to SQL Parser 4.1.9 - it changes namespace to follow PSR-4 --- composer.json | 2 +- composer.lock | 26 ++++++++++++++++---------- src/phpsqllint/Cli.php | 8 ++++---- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 9817169..bde2da1 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "project", "bin": ["bin/php-sqllint"], "require": { - "phpmyadmin/sql-parser": "^3.0", + "phpmyadmin/sql-parser": "^4.1.1", "pear/console_commandline": "^1.2" }, "homepage": "http://cweiske.de/php-sqllint.htm", diff --git a/composer.lock b/composer.lock index 49380ec..a30dda3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "1c18f83b6e7cd2794ed46ab1259603cf", - "content-hash": "48867997935b86e96d572b0c195542ef", + "hash": "642c0759e68495342f0e4ec0a8b45575", + "content-hash": "e52fa298a0c5ce2ff75067ab99b00ce7", "packages": [ { "name": "pear/console_commandline", @@ -117,25 +117,31 @@ }, { "name": "phpmyadmin/sql-parser", - "version": "v3.4.10", + "version": "v4.1.9", "source": { "type": "git", "url": "https://github.com/phpmyadmin/sql-parser.git", - "reference": "5c0905149b38f3c68a5f0545efdcc33c687459ee" + "reference": "deac47217144b21056271674533b289239e1b279" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/5c0905149b38f3c68a5f0545efdcc33c687459ee", - "reference": "5c0905149b38f3c68a5f0545efdcc33c687459ee", + "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/deac47217144b21056271674533b289239e1b279", + "reference": "deac47217144b21056271674533b289239e1b279", "shasum": "" }, "require": { "ext-mbstring": "*", "php": ">=5.3.0" }, + "conflict": { + "phpmyadmin/motranslator": "<3.0" + }, "require-dev": { - "phpunit/php-code-coverage": "~2.0 || ~3.0", - "phpunit/phpunit": "~4.8 || ~5.1" + "phpunit/php-code-coverage": "*", + "phpunit/phpunit": "~4.8 || ~5.7" + }, + "suggest": { + "phpmyadmin/motranslator": "Translate messages to your favorite locale" }, "bin": [ "bin/highlight-query", @@ -144,7 +150,7 @@ "type": "library", "autoload": { "psr-4": { - "SqlParser\\": "src" + "PhpMyAdmin\\SqlParser\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -166,7 +172,7 @@ "parser", "sql" ], - "time": "2016-10-03 16:28:09" + "time": "2017-07-12 14:54:33" } ], "packages-dev": [], diff --git a/src/phpsqllint/Cli.php b/src/phpsqllint/Cli.php index 4edcf66..eecc9b7 100644 --- a/src/phpsqllint/Cli.php +++ b/src/phpsqllint/Cli.php @@ -11,7 +11,7 @@ * @link http://cweiske.de/php-sqllint.htm */ namespace phpsqllint; -use SqlParser\Parser; +use PhpMyAdmin\SqlParser\Parser; require_once 'Console/CommandLine.php'; @@ -84,7 +84,7 @@ class Cli return false; } - $parser = new \SqlParser\Parser($sql); + $parser = new \PhpMyAdmin\SqlParser\Parser($sql); if (count($parser->errors) == 0) { $this->renderer->finishOk(); return true; @@ -98,7 +98,7 @@ class Cli } foreach ($parser->errors as $error) { - /* @var SqlParser\Exceptions\ParserException $error) */ + /* @var PhpMyAdmin\SqlParser\Exceptions\ParserException $error) */ reset($lines); $line = 1; while (next($lines) && $error->token->position >= current($lines)) { @@ -137,7 +137,7 @@ class Cli $options = array( 'type' => $typeMap[$this->highlight], ); - echo \SqlParser\Utils\Formatter::format($sql, $options) . "\n"; + echo \PhpMyAdmin\SqlParser\Utils\Formatter::format($sql, $options) . "\n"; } protected function loadSql($filename) -- 2.30.2