!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/laravel-crm/vendor/php-debugbar/php-debugbar/src/DebugBar/Storage/   drwxrwxrwx
Free 13.14 GB of 57.97 GB (22.68%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     RedisStorage.php (2.74 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/*
 * This file is part of the DebugBar package.
 *
 * (c) 2013 Maxime Bouroumeau-Fuseau
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace DebugBar\Storage;

/**
 * Stores collected data into Redis
 */
class RedisStorage implements StorageInterface
{
    
/** @var \Predis\Client|\Redis */
    
protected $redis;

    
/** @var string */
    
protected $hash;

    
/**
     * @param  \Predis\Client|\Redis $redis Redis Client
     * @param string $hash
     */
    
public function __construct($redis$hash 'phpdebugbar')
    {
        
$this->redis $redis;
        
$this->hash $hash;
    }

    
/**
     * {@inheritdoc}
     */
    
public function save($id$data)
    {
        
$this->redis->hSet("$this->hash:meta"$idserialize($data['__meta']));
        unset(
$data['__meta']);
        
$this->redis->hSet("$this->hash:data"$idserialize($data));
    }

    
/**
     * {@inheritdoc}
     */
    
public function get($id)
    {
        return 
array_merge(unserialize($this->redis->hGet("$this->hash:data"$id)) ?: [],
            array(
'__meta' => unserialize($this->redis->hGet("$this->hash:meta"$id))));
    }

    
/**
     * {@inheritdoc}
     */
    
public function find(array $filters = [], $max 20$offset 0)
    {
        
$results = [];
        
$isPhpRedis get_class($this->redis) === 'Redis' || get_class($this->redis) === 'RedisCluster';
        
$cursor = match (true) {
            
$isPhpRedis && version_compare(phpversion('redis'), '6.1.0''>=') => null,
            default => 
'0',
        };

        do {
            if (
$isPhpRedis) {
                
$data $this->redis->hScan("$this->hash:meta"$cursor);
            } else {
                [
$cursor$data] = $this->redis->hScan("$this->hash:meta"$cursor);
            }

            foreach (
$data as $meta) {
                if (
$meta unserialize($meta)) {
                    if (
$this->filter($meta$filters)) {
                        
$results[] = $meta;
                    }
                }
            }
        } while(
$cursor);

        
usort($results, static function ($a$b) {
            return 
$b['utime'] <=> $a['utime'];
        });

        return 
array_slice($results$offset$max);
    }

    
/**
     * Filter the metadata for matches.
     */
    
protected function filter($meta$filters)
    {
        foreach (
$filters as $key => $value) {
            if (!isset(
$meta[$key]) || fnmatch($value$meta[$key]) === false) {
                return 
false;
            }
        }
        return 
true;
    }

    
/**
     * {@inheritdoc}
     */
    
public function clear()
    {
        
$this->redis->del("$this->hash:data");
        
$this->redis->del("$this->hash:meta");
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0072 ]--