From: Christian Weiske Date: Thu, 10 Dec 2015 22:12:33 +0000 (+0100) Subject: .phar build script X-Git-Tag: v0.0.1 X-Git-Url: https://git.cweiske.de/php-sqllint.git/commitdiff_plain/91615feeb41b0aaa6aeaf941da99efcd96e6f0c0 .phar build script --- diff --git a/.gitignore b/.gitignore index 4d82a7b..c1e6936 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /composer.lock /vendor /README.html +/dist +/bin/phar-php-sqllint.php diff --git a/README.rst b/README.rst index 375ffd4..bca5a30 100644 --- a/README.rst +++ b/README.rst @@ -13,7 +13,7 @@ Usage ===== :: - $ ./bin/php-sqllint tests/files/create-missingcomma.sql + $ php-sqllint tests/files/create-missingcomma.sql Checking SQL syntax of tests/files/create-missingcomma.sql Line 3, col 5 at "pid": A comma or a closing bracket was expected. Line 3, col 13 at "11": Unexpected beginning of statement. @@ -21,12 +21,22 @@ Usage Emacs mode:: - $ ./bin/php-sqllint -r emacs tests/files/create-noname.sql + $ php-sqllint -r emacs tests/files/create-noname.sql tests/files/create-noname.sql:1.12:Error: The name of the entity was expected. tests/files/create-noname.sql:1.13:Error: A closing bracket was expected. tests/files/create-noname.sql:1.13:Error: At least one column definition was expected. +==== +Bugs +==== +Does ``php-sqllint`` not detect a syntax error, or doesn't support a certain +SQL statement? +Then please report a bug at `udan11/sql-parser`__. + +__ https://github.com/udan11/sql-parser + + ============ Dependencies ============ @@ -38,6 +48,29 @@ __ https://github.com/udan11/sql-parser __ https://www.phpmyadmin.net/ +Dependency installation +======================= +:: + + $ composer install + +Now you can use ``./bin/php-sqllint`` without building the phar yourself. + + +======== +Building +======== +You'll need `phing`__, the PHP build tool:: + + $ phing + +__ https://www.phing.info/ + +The result are ``.phar`` files in ``dist/`` directory that you can execute:: + + $ ./dist/php-sqllint-0.0.1.phar tests/files/create-noname.sql + Checking SQL syntax of tests/files/create-noname.sql + Line 1, col 12 at "(": The name of the entity was expected. ================= @@ -53,6 +86,8 @@ __ http://www.gnu.org/licenses/agpl.html Homepage ======== +Home page + http://cweiske.de/php-sqllint.htm Source code http://git.cweiske.de/php-sqllint.git diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..d9ca6d5 --- /dev/null +++ b/build.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/composer.json b/composer.json index 750ddf1..6dcd292 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,6 @@ { "require": { - "udan11/sql-parser": "^3.0" + "udan11/sql-parser": "^3.0", + "pear/console_commandline": "^1.2" } } diff --git a/src/stub-phar.php b/src/stub-phar.php new file mode 100644 index 0000000..71f0586 --- /dev/null +++ b/src/stub-phar.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php + + * @copyright 2015 Christian Weiske + * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3 + * @link http://cweiske.de/php-sqllint.htm + */ +require 'phar://' . __FILE__ . '/bin/phar-php-sqllint.php'; +__HALT_COMPILER(); +?>