!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.28 GB of 57.97 GB (22.91%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     FilesystemCommonTrait.php (3.9 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\Exception\InvalidArgumentException;

/**
 * @author Nicolas Grekas <p@tchwork.com>
 *
 * @internal
 */
trait FilesystemCommonTrait
{
    private 
$directory;
    private 
$tmp;

    private function 
init($namespace$directory)
    {
        if (!isset(
$directory[0])) {
            
$directory sys_get_temp_dir().'/symfony-cache';
        } else {
            
$directory realpath($directory) ?: $directory;
        }
        if (isset(
$namespace[0])) {
            if (
preg_match('#[^-+_.A-Za-z0-9]#'$namespace$match)) {
                throw new 
InvalidArgumentException(sprintf('Namespace contains "%s" but only characters in [-+_.A-Za-z0-9] are allowed.'$match[0]));
            }
            
$directory .= \DIRECTORY_SEPARATOR.$namespace;
        }
        if (!
file_exists($directory)) {
            @
mkdir($directory0777true);
        }
        
$directory .= \DIRECTORY_SEPARATOR;
        
// On Windows the whole path is limited to 258 chars
        
if ('\\' === \DIRECTORY_SEPARATOR && \strlen($directory) > 234) {
            throw new 
InvalidArgumentException(sprintf('Cache directory too long (%s)'$directory));
        }

        
$this->directory $directory;
    }

    
/**
     * {@inheritdoc}
     */
    
protected function doClear($namespace)
    {
        
$ok true;

        foreach (new 
\RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->directory\FilesystemIterator::SKIP_DOTS)) as $file) {
            
$ok = ($file->isDir() || $this->doUnlink($file) || !file_exists($file)) && $ok;
        }

        return 
$ok;
    }

    
/**
     * {@inheritdoc}
     */
    
protected function doDelete(array $ids)
    {
        
$ok true;

        foreach (
$ids as $id) {
            
$file $this->getFile($id);
            
$ok = (!file_exists($file) || $this->doUnlink($file) || !file_exists($file)) && $ok;
        }

        return 
$ok;
    }

    protected function 
doUnlink($file)
    {
        return @
unlink($file);
    }

    private function 
write($file$data$expiresAt null)
    {
        
set_error_handler(__CLASS__.'::throwError');
        try {
            if (
null === $this->tmp) {
                
$this->tmp $this->directory.uniqid(''true);
            }
            
file_put_contents($this->tmp$data);

            if (
null !== $expiresAt) {
                
touch($this->tmp$expiresAt);
            }

            return 
rename($this->tmp$file);
        } finally {
            
restore_error_handler();
        }
    }

    private function 
getFile($id$mkdir falsestring $directory null)
    {
        
// Use MD5 to favor speed over security, which is not an issue here
        
$hash str_replace('/''-'base64_encode(hash('md5', static::class.$idtrue)));
        
$dir = ($directory ?? $this->directory).strtoupper($hash[0].\DIRECTORY_SEPARATOR.$hash[1].\DIRECTORY_SEPARATOR);

        if (
$mkdir && !file_exists($dir)) {
            @
mkdir($dir0777true);
        }

        return 
$dir.substr($hash220);
    }

    
/**
     * @internal
     */
    
public static function throwError($type$message$file$line)
    {
        throw new 
\ErrorException($message0$type$file$line);
    }

    public function 
__sleep()
    {
        throw new 
\BadMethodCallException('Cannot serialize '.__CLASS__);
    }

    public function 
__wakeup()
    {
        throw new 
\BadMethodCallException('Cannot unserialize '.__CLASS__);
    }

    public function 
__destruct()
    {
        if (
method_exists(parent::class, '__destruct')) {
            
parent::__destruct();
        }
        if (
null !== $this->tmp && file_exists($this->tmp)) {
            
unlink($this->tmp);
        }
    }
}

:: 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.1096 ]--