-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
147 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/composer.lock | ||
/vendor | ||
/README.html | ||
/dist | ||
/bin/phar-php-sqllint.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<project name="php-sqllint" default="phar" basedir="."> | ||
|
||
<property name="version" value="0.0.1" /> | ||
<property name="pharfile" value="${phing.dir}/dist/${phing.project.name}-${version}.phar" /> | ||
<property name="pharfilebz2" value="${phing.dir}/dist/${phing.project.name}-${version}.bz2.phar" /> | ||
<property name="libdir" value="${phing.dir}/lib"/> | ||
|
||
<fileset id="fs.phar" dir="${phing.dir}"> | ||
<include name="bin/**"/> | ||
<include name="lib/**"/> | ||
<include name="src/**"/> | ||
|
||
<include name="README.rst"/> | ||
|
||
<include name="vendor/autoload.php"/> | ||
<include name="vendor/composer/*.php"/> | ||
<include name="vendor/pear/console_commandline/Console/**"/> | ||
<include name="vendor/pear/pear_exception/PEAR/**"/> | ||
<include name="vendor/udan11/sql-parser/src/**"/> | ||
</fileset> | ||
|
||
|
||
<typedef name="pearPackageFileSet" classname="phing.types.PearPackageFileSet" /> | ||
|
||
<target name="phar" depends="collectdeps" | ||
description="Create zip file for release" | ||
> | ||
<!-- strip the shebang from bin script --> | ||
<copy file="${phing.dir}/bin/php-sqllint" tofile="${phing.dir}/bin/phar-php-sqllint.php"> | ||
<filterchain> | ||
<striplinecomments> | ||
<comment value="#" /> | ||
</striplinecomments> | ||
</filterchain> | ||
</copy> | ||
|
||
<mkdir dir="${phing.dir}/dist"/> | ||
<delete file="${pharfile}"/> | ||
<pharpackage basedir="${phing.dir}" | ||
destfile="${pharfile}" | ||
stub="${phing.dir}/src/stub-phar.php" | ||
alias="php-sqllint.phar" | ||
compression="none" | ||
> | ||
<fileset refid="fs.phar"/> | ||
</pharpackage> | ||
|
||
<pharpackage basedir="${phing.dir}" | ||
destfile="${pharfilebz2}" | ||
stub="${phing.dir}/src/stub-phar.php" | ||
alias="php-sqllint.phar" | ||
compression="bzip2" | ||
> | ||
<fileset refid="fs.phar"/> | ||
</pharpackage> | ||
|
||
<exec executable="chmod"> | ||
<arg value="+x"/> | ||
<arg value="${pharfile}"/> | ||
<arg value="${pharfilebz2}"/> | ||
</exec> | ||
</target> | ||
|
||
|
||
<target name="collectdeps" description="Copy package dependencies to lib/"> | ||
<exec command="composer install"/> | ||
<!-- | ||
<delete dir="${libdir}"/> | ||
<mkdir dir="${libdir}"/> | ||
<pearPackageFileset id="dep-Console_CommandLine" package="pear.php.net/Console_CommandLine"/> | ||
<pearPackageFileset id="dep-PEAR" package="pear.php.net/PEAR"> | ||
<include name="PEAR/Exception.php"/> | ||
</pearPackageFileset> | ||
<copy todir="${libdir}"> | ||
<fileset refid="dep-Console_CommandLine"/> | ||
<fileset refid="dep-PEAR"/> | ||
</copy> | ||
--> | ||
</target> | ||
|
||
|
||
<target name="docs" description="render documentation"> | ||
<rst file="README.rst"/> | ||
</target> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"require": { | ||
"udan11/sql-parser": "^3.0" | ||
"udan11/sql-parser": "^3.0", | ||
"pear/console_commandline": "^1.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
/** | ||
* Phar stub file for php-sqllint. Handles startup of the .phar file. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category Tools | ||
* @package PHP-SQLlint | ||
* @author Christian Weiske <[email protected]> | ||
* @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(); | ||
?> |