init without trunk
This commit is contained in:
parent
ed24ac4994
commit
bb809e7233
14652 changed files with 177862 additions and 94817 deletions
17
vendor/jdorn/sql-formatter/examples/cli.php
vendored
Normal file
17
vendor/jdorn/sql-formatter/examples/cli.php
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
if(php_sapi_name() !== "cli") {
|
||||
echo "<p>Run this php script from the command line to see CLI syntax highlighting and formatting. It support Unix pipes or command line argument style.</p>";
|
||||
echo "<pre><code>php examples/cli.php \"SELECT * FROM MyTable WHERE (id>5 AND \\`name\\` LIKE \\"testing\\");\"</code></pre>";
|
||||
echo "<pre><code>echo \"SELECT * FROM MyTable WHERE (id>5 AND \\`name\\` LIKE \\"testing\\");\" | php examples/cli.php</code></pre>";
|
||||
}
|
||||
|
||||
if(isset($argv[1])) {
|
||||
$sql = $argv[1];
|
||||
}
|
||||
else {
|
||||
$sql = stream_get_contents(fopen("php://stdin", "r"));
|
||||
}
|
||||
|
||||
require_once(__DIR__.'/../lib/SqlFormatter.php');
|
||||
|
||||
echo SqlFormatter::format($sql);
|
||||
Loading…
Add table
Add a link
Reference in a new issue