__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
<?php

declare(strict_types=1);

namespace PhpMyAdmin\SqlParser\Utils;

use PhpMyAdmin\SqlParser\Exceptions\LexerException;
use PhpMyAdmin\SqlParser\Exceptions\ParserException;
use PhpMyAdmin\SqlParser\Lexer;
use PhpMyAdmin\SqlParser\Parser;

use function htmlspecialchars;
use function sprintf;

/**
 * Error related utilities.
 */
class Error
{
    /**
     * Gets the errors of a lexer and a parser.
     *
     * @param array<int|string, Lexer|Parser> $objs objects from where the errors will be extracted
     *
     * @return array<int, array<int, int|string|null>> Each element of the array represents an error.
     *               `$err[0]` holds the error message.
     *               `$err[1]` holds the error code.
     *               `$err[2]` holds the string that caused the issue.
     *               `$err[3]` holds the position of the string.
     *               (i.e. `[$msg, $code, $str, $pos]`)
     */
    public static function get($objs)
    {
        $ret = [];

        foreach ($objs as $obj) {
            if ($obj instanceof Lexer) {
                /** @var LexerException $err */
                foreach ($obj->errors as $err) {
                    $ret[] = [
                        $err->getMessage(),
                        $err->getCode(),
                        $err->ch,
                        $err->pos,
                    ];
                }
            } elseif ($obj instanceof Parser) {
                /** @var ParserException $err */
                foreach ($obj->errors as $err) {
                    $ret[] = [
                        $err->getMessage(),
                        $err->getCode(),
                        $err->token->token,
                        $err->token->position,
                    ];
                }
            }
        }

        return $ret;
    }

    /**
     * Formats the specified errors.
     *
     * @param array<int, array<int, int|string|null>> $errors the errors to be formatted
     * @param string                                  $format The format of an error.
     *                       '$1$d' is replaced by the position of this error.
     *                       '$2$s' is replaced by the error message.
     *                       '$3$d' is replaced by the error code.
     *                       '$4$s' is replaced by the string that caused the
     *                       issue.
     *                       '$5$d' is replaced by the position of the string.
     *
     * @return string[]
     */
    public static function format(
        $errors,
        $format = '#%1$d: %2$s (near "%4$s" at position %5$d)'
    ) {
        $ret = [];

        $i = 0;
        foreach ($errors as $key => $err) {
            $ret[$key] = sprintf(
                $format,
                ++$i,
                $err[0],
                $err[1],
                htmlspecialchars((string) $err[2]),
                $err[3]
            );
        }

        return $ret;
    }
}

Filemanager

Name Type Size Permission Actions
BufferedQuery.php File 13.5 KB 0644
CLI.php File 6.57 KB 0644
Error.php File 2.91 KB 0644
Formatter.php File 23.03 KB 0644
Misc.php File 2.91 KB 0644
Query.php File 27.8 KB 0644
Routine.php File 3.52 KB 0644
Table.php File 3.62 KB 0644
Tokens.php File 4.06 KB 0644
Filemanager