!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/Adapter/   drwxr-xr-x
Free 13.31 GB of 57.97 GB (22.96%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     FilesystemTagAwareAdapter.php (4.51 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\Adapter;

use 
Symfony\Component\Cache\Marshaller\DefaultMarshaller;
use 
Symfony\Component\Cache\Marshaller\MarshallerInterface;
use 
Symfony\Component\Cache\PruneableInterface;
use 
Symfony\Component\Cache\Traits\FilesystemTrait;

/**
 * Stores tag id <> cache id relationship as a symlink, and lookup on invalidation calls.
 *
 * @author Nicolas Grekas <p@tchwork.com>
 * @author André Rømcke <andre.romcke+symfony@gmail.com>
 *
 * @experimental in 4.3
 */
class FilesystemTagAwareAdapter extends AbstractTagAwareAdapter implements PruneableInterface
{
    use 
FilesystemTrait {
        
doSave as private doSaveCache;
        
doDelete as private doDeleteCache;
    }

    
/**
     * Folder used for tag symlinks.
     */
    
private const TAG_FOLDER 'tags';

    public function 
__construct(string $namespace ''int $defaultLifetime 0string $directory nullMarshallerInterface $marshaller null)
    {
        
$this->marshaller $marshaller ?? new DefaultMarshaller();
        
parent::__construct(''$defaultLifetime);
        
$this->init($namespace$directory);
    }

    
/**
     * {@inheritdoc}
     */
    
protected function doSave(array $values, ?int $lifetime, array $addTagData = [], array $removeTagData = []): array
    {
        
$failed $this->doSaveCache($values$lifetime);

        
// Add Tags as symlinks
        
foreach ($addTagData as $tagId => $ids) {
            
$tagFolder $this->getTagFolder($tagId);
            foreach (
$ids as $id) {
                if (
$failed && \in_array($id$failedtrue)) {
                    continue;
                }

                
$file $this->getFile($id);

                if (!@
symlink($file$this->getFile($idtrue$tagFolder))) {
                    @
unlink($file);
                    
$failed[] = $id;
                }
            }
        }

        
// Unlink removed Tags
        
foreach ($removeTagData as $tagId => $ids) {
            
$tagFolder $this->getTagFolder($tagId);
            foreach (
$ids as $id) {
                if (
$failed && \in_array($id$failedtrue)) {
                    continue;
                }

                @
unlink($this->getFile($idfalse$tagFolder));
            }
        }

        return 
$failed;
    }

    
/**
     * {@inheritdoc}
     */
    
protected function doDelete(array $ids, array $tagData = []): bool
    
{
        
$ok $this->doDeleteCache($ids);

        
// Remove tags
        
foreach ($tagData as $tagId => $idMap) {
            
$tagFolder $this->getTagFolder($tagId);
            foreach (
$idMap as $id) {
                @
unlink($this->getFile($idfalse$tagFolder));
            }
        }

        return 
$ok;
    }

    
/**
     * {@inheritdoc}
     */
    
protected function doInvalidate(array $tagIds): bool
    
{
        foreach (
$tagIds as $tagId) {
            if (!
file_exists($tagFolder $this->getTagFolder($tagId))) {
                continue;
            }

            
set_error_handler(static function () {});

            try {
                if (
rename($tagFolder$renamed substr_replace($tagFolderbin2hex(random_bytes(4)), -1))) {
                    
$tagFolder $renamed.\DIRECTORY_SEPARATOR;
                } else {
                    
$renamed null;
                }

                foreach (new 
\RecursiveIteratorIterator(new \RecursiveDirectoryIterator($tagFolder\FilesystemIterator::SKIP_DOTS \FilesystemIterator::CURRENT_AS_PATHNAME)) as $itemLink) {
                    
unlink(realpath($itemLink) ?: $itemLink);
                    
unlink($itemLink);
                }

                if (
null === $renamed) {
                    continue;
                }

                
$chars '+-ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';

                for (
$i 0$i 38; ++$i) {
                    for (
$j 0$j 38; ++$j) {
                        
rmdir($tagFolder.$chars[$i].\DIRECTORY_SEPARATOR.$chars[$j]);
                    }
                    
rmdir($tagFolder.$chars[$i]);
                }
                
rmdir($renamed);
            } finally {
                
restore_error_handler();
            }
        }

        return 
true;
    }

    private function 
getTagFolder(string $tagId): string
    
{
        return 
$this->getFile($tagIdfalse$this->directory.self::TAG_FOLDER.\DIRECTORY_SEPARATOR).\DIRECTORY_SEPARATOR;
    }
}

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