Page MenuHomeWickedGov Phorge

skip-linting.php
No OneTemporary

Size
629 B
Referenced Files
None
Subscribers
None

skip-linting.php

<?php
$stdin = fopen('php://stdin', 'r');
$input = stream_get_contents($stdin);
fclose($stdin);
foreach (explode(PHP_EOL, $input) as $file) {
$skip = false;
$f = @fopen($file, 'r');
if ($f) {
$firstLine = fgets($f);
// ignore shebang line
if (strpos($firstLine, '#!') === 0) {
$firstLine = fgets($f);
}
@fclose($f);
if (preg_match('~<?php\\s*\\/\\/\s*lint\s*([^\d\s]+)\s*([^\s]+)\s*~i', $firstLine, $m)) {
$skip = version_compare(PHP_VERSION, $m[2], $m[1]) === false;
}
}
echo $file . ';' . ($skip ? '1' : '0') . PHP_EOL;
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Nov 21, 18:22 (19 h, 37 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e0/97/b2e890c1fa5e63055206324664de
Default Alt Text
skip-linting.php (629 B)

Event Timeline