From: Christian Weiske Date: Tue, 15 Dec 2015 06:43:09 +0000 (+0100) Subject: Allow .phar renaming X-Git-Tag: v0.1.0~6 X-Git-Url: https://git.cweiske.de/php-sqllint.git/commitdiff_plain/a3efc5374a210e045b0c3b3d95153f2f64e48067?ds=sidebyside Allow .phar renaming Without this code, trying to execute "php-sqllint" without the ".phar" extension would result in a fatal error > PHP Warning: require(..) > failed to open stream: phar error: invalid url or non-existent phar --- diff --git a/src/stub-phar.php b/src/stub-phar.php index 71f0586..5c8629e 100644 --- a/src/stub-phar.php +++ b/src/stub-phar.php @@ -12,6 +12,7 @@ * @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'; +Phar::mapPhar('php-sqllint.phar'); +require 'phar://php-sqllint.phar/bin/phar-php-sqllint.php'; __HALT_COMPILER(); ?>