!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)

/usr/share/php/Symfony/Component/Cache/Traits/   drwxr-xr-x
Free 13.19 GB of 57.97 GB (22.76%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     PhpArrayTrait.php (4.41 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Cache\Traits;

use 
Symfony\Component\Cache\CacheItem;
use 
Symfony\Component\Cache\Exception\InvalidArgumentException;
use 
Symfony\Component\VarExporter\VarExporter;

/**
 * @author Titouan Galopin <galopintitouan@gmail.com>
 * @author Nicolas Grekas <p@tchwork.com>
 *
 * @internal
 */
trait PhpArrayTrait
{
    use 
ProxyTrait;

    private 
$file;
    private 
$keys;
    private 
$values;

    
/**
     * Store an array of cached values.
     *
     * @param array $values The cached values
     */
    
public function warmUp(array $values)
    {
        if (
file_exists($this->file)) {
            if (!
is_file($this->file)) {
                throw new 
InvalidArgumentException(sprintf('Cache path exists and is not a file: %s.'$this->file));
            }

            if (!
is_writable($this->file)) {
                throw new 
InvalidArgumentException(sprintf('Cache file is not writable: %s.'$this->file));
            }
        } else {
            
$directory \dirname($this->file);

            if (!
is_dir($directory) && !@mkdir($directory0777true)) {
                throw new 
InvalidArgumentException(sprintf('Cache directory does not exist and cannot be created: %s.'$directory));
            }

            if (!
is_writable($directory)) {
                throw new 
InvalidArgumentException(sprintf('Cache directory is not writable: %s.'$directory));
            }
        }

        
$dumpedValues '';
        
$dumpedMap = [];
        
$dump = <<<'EOF'
<?php

// This file has been auto-generated by the Symfony Cache Component.

return [[


EOF;

        foreach (
$values as $key => $value) {
            
CacheItem::validateKey(\is_int($key) ? (string) $key $key);
            
$isStaticValue true;

            if (
null === $value) {
                
$value "'N;'";
            } elseif (
\is_object($value) || \is_array($value)) {
                try {
                    
$value VarExporter::export($value$isStaticValue);
                } catch (
\Exception $e) {
                    throw new 
InvalidArgumentException(sprintf('Cache key "%s" has non-serializable %s value.'$key\is_object($value) ? \get_class($value) : 'array'), 0$e);
                }
            } elseif (
\is_string($value)) {
                
// Wrap "N;" in a closure to not confuse it with an encoded `null`
                
if ('N;' === $value) {
                    
$isStaticValue false;
                }
                
$value var_export($valuetrue);
            } elseif (!
is_scalar($value)) {
                throw new 
InvalidArgumentException(sprintf('Cache key "%s" has non-serializable %s value.'$key\gettype($value)));
            } else {
                
$value var_export($valuetrue);
            }

            if (!
$isStaticValue) {
                
$value str_replace("\n""\n    "$value);
                
$value "static function () {\n    return {$value};\n}";
            }
            
$hash hash('md5'$value);

            if (
null === $id $dumpedMap[$hash] ?? null) {
                
$id $dumpedMap[$hash] = \count($dumpedMap);
                
$dumpedValues .= "{$id} => {$value},\n";
            }

            
$dump .= var_export($keytrue)." => {$id},\n";
        }

        
$dump .= "\n], [\n\n{$dumpedValues}\n]];\n";

        
$tmpFile uniqid($this->filetrue);

        
file_put_contents($tmpFile$dump);
        @
chmod($tmpFile0666 & ~umask());
        unset(
$serialized$value$dump);

        @
rename($tmpFile$this->file);

        
$this->initialize();
    }

    
/**
     * {@inheritdoc}
     */
    
public function clear()
    {
        
$this->keys $this->values = [];

        
$cleared = @unlink($this->file) || !file_exists($this->file);

        return 
$this->pool->clear() && $cleared;
    }

    
/**
     * Load the cache file.
     */
    
private function initialize()
    {
        if (!
file_exists($this->file)) {
            
$this->keys $this->values = [];

            return;
        }
        
$values = (include $this->file) ?: [[], []];

        if (
!== \count($values) || !isset($values[0], $values[1])) {
            
$this->keys $this->values = [];
        } else {
            list(
$this->keys$this->values) = $values;
        }
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

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