HEX
Server: Apache
System: Linux srv13.cpanelhost.cl 3.10.0-962.3.2.lve1.5.38.el7.x86_64 #1 SMP Thu Jun 18 05:28:41 EDT 2020 x86_64
User: cca63905 (4205)
PHP: 7.3.20
Disabled: NONE
Upload Files
File: //proc/self/root/proc/self/root/proc/self/cwd/nueva/vendor/jdorn/sql-formatter/examples/cli.php
<?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 \\&quot;testing\\&quot;);\"</code></pre>";
	echo "<pre><code>echo \"SELECT * FROM MyTable WHERE (id>5 AND \\`name\\` LIKE \\&quot;testing\\&quot;);\" | 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);