Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 18.221.248.199
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/bin/jsonlint-php
#!/usr/bin/php
<?php

/*
 * This file is part of the JSON Lint package.
 *
 * (c) Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

function includeIfExists($file)
{
    if (file_exists($file)) {
        return include $file;
    }
}

includeIfExists('/usr/share/php/Seld/JsonLint/autoload.php');

use Seld\JsonLint\JsonParser;

$file = null;
$quiet = false;

if (isset($_SERVER['argc']) && $_SERVER['argc'] > 1) {
    for ($i = 1; $i < $_SERVER['argc']; $i++) {
        $arg = $_SERVER['argv'][$i];
        if ($arg == '-q' || $arg == '--quiet') {
            $quiet = true;
        } else if ($arg == '-h' || $arg == '--help') {
            showUsage();
        } else {
            $file = $arg;
        }
    }
}

if (!$file) {
    if ($contents = file_get_contents('php://stdin')) {
        lint($contents);
    } else {
        fwrite(STDERR, 'No file name or json input given'.PHP_EOL);
        exit(1);
    }
} else {
    if (!preg_match('{^https?://}i', $file)) {
        if (!file_exists($file)) {
            fwrite(STDERR, 'File not found: '.$file.PHP_EOL);
            exit(1);
        }
        if (!is_readable($file)) {
            fwrite(STDERR, 'File not readable: '.$file.PHP_EOL);
            exit(1);
        }
    }
}

lintFile($file, $quiet);

function lint($content, $quiet = false)
{
    $parser = new JsonParser();
    if ($err = $parser->lint($content)) {
        fwrite(STDERR, $err->getMessage().PHP_EOL);
        exit(1);
    }
    if (!$quiet) {
        echo 'Valid JSON'.PHP_EOL;
    }
    exit(0);
}

function lintFile($file, $quiet = false)
{
    $content = file_get_contents($file);
    $parser = new JsonParser();
    if ($err = $parser->lint($content)) {
        fwrite(STDERR, $file.': '.$err->getMessage().PHP_EOL);
        exit(1);
    }
    if (!$quiet) {
        echo 'Valid JSON'.PHP_EOL;
    }
    exit(0);
}

function showUsage()
{
    echo 'Usage: jsonlint file [options]'.PHP_EOL;
    echo PHP_EOL;
    echo 'Options:'.PHP_EOL;
    echo '  -q, --quiet     Cause jsonlint to be quiet when no errors are found'.PHP_EOL;
    echo '  -h, --help      Show this message'.PHP_EOL;
    exit(0);
}

Anon7 - 2022
AnonSec Team