__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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 Williamdes\MariaDBMySQLKBS;

use stdClass;

class Search
{
    /**
     * Loaded data
     *
     * @var stdClass
     */
    public static $data;

    /**
     * Data is loaded
     *
     * @var bool
     */
    public static $loaded = false;

    public const ANY     = -1;
    public const MYSQL   = 1;
    public const MARIADB = 2;
    public const DS      = DIRECTORY_SEPARATOR;

    /**
     * The directory where the data is located
     *
     * @var string
     */
    public static $DATA_DIR = '/usr/share/php/data/Williamdes/MariaDBMySQLKBS/';

    /**
     * Load data from disk
     *
     * @return void
     * @throws KBException
     */
    public static function loadData(): void
    {
        if (Search::$loaded === false) {
            $filePath = Search::$DATA_DIR . 'merged-ultraslim.json';
            if (! is_file($filePath)) {
                throw new KBException($filePath . ' does not exist !');
            }
            $contents = file_get_contents($filePath);
            if ($contents === false) {
                throw new KBException($filePath . ' does not exist !');
            }
            $decodedData = json_decode($contents);
            if ($decodedData instanceof stdClass) {
                Search::$data   = $decodedData;
                Search::$loaded = true;
                return;
            }
            throw new KBException($filePath . ' could not be JSON decoded !');
        }
    }

    /**
     * Load test data
     *
     * @param SlimData $slimData The SlimData object
     * @return void
     */
    public static function loadTestData(SlimData $slimData): void
    {
        $decodedData = json_decode((string) json_encode($slimData));
        if ($decodedData instanceof stdClass) {
            Search::$data   = $decodedData;
            Search::$loaded = true;
        }
    }

    /**
     * get the first link to doc available
     *
     * @param string $name Name of variable
     * @param int    $type (optional) Type of link Search::MYSQL/Search::MARIADB/Search::ANY
     * @return string
     * @throws KBException
     */
    public static function getByName(string $name, int $type = Search::ANY): string
    {
        self::loadData();
        $kbEntries = self::getVariable($name);
        if (isset($kbEntries->a)) {
            foreach ($kbEntries->a as $kbEntry) {
                if ($type === Search::ANY) {
                    return Search::$data->urls[$kbEntry->u] . '#' . $kbEntry->a;
                } elseif ($type === Search::MYSQL) {
                    if ($kbEntry->t === Search::MYSQL) {
                        return Search::$data->urls[$kbEntry->u] . '#' . $kbEntry->a;
                    }
                } elseif ($type === Search::MARIADB) {
                    if ($kbEntry->t === Search::MARIADB) {
                        return Search::$data->urls[$kbEntry->u] . '#' . $kbEntry->a;
                    }
                }
            }
        }

        throw new KBException($name . ' does not exist for this type of documentation !');
    }

    /**
     * Get a variable
     *
     * @param string $name Name of variable
     * @return stdClass
     * @throws KBException
     */
    public static function getVariable(string $name): stdClass
    {
        self::loadData();
        if (isset(Search::$data->vars->{$name})) {
            return Search::$data->vars->{$name};
        } else {
            throw new KBException($name . ' does not exist !');
        }
    }

    /**
     * get the type of the variable
     *
     * @param string $name Name of variable
     * @return string
     * @throws KBException
     */
    public static function getVariableType(string $name): string
    {
        self::loadData();
        $kbEntry = self::getVariable($name);
        if (isset($kbEntry->t)) {
            return Search::$data->varTypes->{$kbEntry->t};
        } else {
            throw new KBException($name . ' does have a known type !');
        }
    }

    /**
     * Return the list of static variables
     *
     * @return array<int,string>
     */
    public static function getStaticVariables(): array
    {
        return self::getVariablesWithDynamic(false);
    }

    /**
     * Return the list of dynamic variables
     *
     * @return array<int,string>
     */
    public static function getDynamicVariables(): array
    {
        return self::getVariablesWithDynamic(true);
    }

    /**
     * Return the list of variables having dynamic = $dynamic
     *
     * @param bool $dynamic dynamic=true/dynamic=false
     * @return array<int,string>
     */
    public static function getVariablesWithDynamic(bool $dynamic): array
    {
        self::loadData();
        $staticVars = [];
        foreach (Search::$data->vars as $name => $var) {
            if (isset($var->d)) {
                if ($var->d === $dynamic) {
                    $staticVars[] = $name;
                }
            }
        }
        return $staticVars;
    }

}

Filemanager

Name Type Size Permission Actions
KBDocumentation.php File 1.33 KB 0644
KBEntry.php File 2.98 KB 0644
KBException.php File 130 B 0644
Search.php File 4.91 KB 0644
SlimData.php File 4.54 KB 0644
autoload.php File 851 B 0644
Filemanager