diff options
author | Haru <haru@dotalux.com> | 2019-11-18 21:02:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-18 21:02:01 +0100 |
commit | 5e61cd4f23492fded25d48a4d6609603d916c5e5 (patch) | |
tree | fae5542ba5319753087129d92b6f8032b9a09147 /tools/php-sqllint/bin | |
parent | fac2eef6c66b1da34c68963732f8afece3a5289f (diff) | |
parent | 8312581eb96d1d497fbce59a7a33fc55a6c236b5 (diff) | |
download | hercules-5e61cd4f23492fded25d48a4d6609603d916c5e5.tar.gz hercules-5e61cd4f23492fded25d48a4d6609603d916c5e5.tar.bz2 hercules-5e61cd4f23492fded25d48a4d6609603d916c5e5.tar.xz hercules-5e61cd4f23492fded25d48a4d6609603d916c5e5.zip |
Merge pull request #2582 from 4144/sqlvalidation
Add script for sql files syntax validation
Diffstat (limited to 'tools/php-sqllint/bin')
-rwxr-xr-x | tools/php-sqllint/bin/php-sqllint | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/php-sqllint/bin/php-sqllint b/tools/php-sqllint/bin/php-sqllint new file mode 100755 index 000000000..fd766bc07 --- /dev/null +++ b/tools/php-sqllint/bin/php-sqllint @@ -0,0 +1,31 @@ +#!/usr/bin/env php +<?php +/** + * SQL linter (syntax checker) written in PHP + * + * PHP version 5 + * + * @category Tools + * @package PHP-SQLlint + * @author Christian Weiske <cweiske@cweiske.de> + * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3 + * @link http://cweiske.de/php-sqllint.htm + */ +namespace phpsqllint; + +if (file_exists(__DIR__ . '/../vendor/autoload.php')) { + //local git checkout + include_once __DIR__ . '/../vendor/autoload.php'; +} else if (file_exists('vendor/autoload.php')) { + //dependency composer installation + include_once 'vendor/autoload.php'; +} + +if (file_exists(__DIR__ . '/../src/phpsqllint/Autoloader.php')) { + include_once __DIR__ . '/../src/phpsqllint/Autoloader.php'; + Autoloader::register(); +} + +$cli = new Cli(); +$cli->run(); +?>
\ No newline at end of file |