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

[email protected]: ~ $
<?php

namespace Tuf\Client\DurableStorage;

use Tuf\Metadata\StorageBase;

/**
 * Defines a simple filesystem-based storage for fetched PHP-TUF metadata.
 *
 * Applications might want to provide an alternative implementation with
 * better performance and error handling.
 */
class FileStorage extends StorageBase
{
    /**
     * Constructs a new FileStorage instance.
     *
     * @param string $basePath
     *     The path on the filesystem to this durable storage's files.
     *
     * @throws \RuntimeException
     *     Thrown if the base path is not an accessible, existing directory.
     */
    public function __construct(protected string $basePath)
    {
        if (! is_dir($basePath)) {
            throw new \RuntimeException("Cannot initialize filesystem local state: '$basePath' is not a directory.");
        }
    }

    /**
     * Returns a full path for an item in the storage.
     *
     * @param string $name
     *   The name of the item.
     *
     * @return string
     *   The full path for the item in the storage.
     */
    protected function toPath(string $name): string
    {
        return $this->basePath . DIRECTORY_SEPARATOR . urlencode($name) . '.json';
    }

    protected function read(string $name): ?string
    {
        $path = $this->toPath($name);
        return file_exists($path) ? file_get_contents($path) : null;
    }

    protected function write(string $name, string $data): void
    {
        file_put_contents($this->toPath($name), $data);
    }

    public function delete(string $name): void
    {
        @unlink($this->toPath($name));
    }
}

Filemanager

Name Type Size Permission Actions
FileStorage.php File 1.57 KB 0664
Filemanager