!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/smm.picotech.app/public_html/vendor/psy/psysh/src/Command/TimeitCommand/   drwxr-xr-x
Free 28.55 GB of 117.98 GB (24.2%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

/*
 * This file is part of Psy Shell.
 *
 * (c) 2012-2023 Justin Hileman
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Psy\Command\TimeitCommand;

use 
PhpParser\Node;
use 
PhpParser\Node\Arg;
use 
PhpParser\Node\Expr;
use 
PhpParser\Node\Expr\StaticCall;
use 
PhpParser\Node\FunctionLike;
use 
PhpParser\Node\Name\FullyQualified as FullyQualifiedName;
use 
PhpParser\Node\Stmt\Expression;
use 
PhpParser\Node\Stmt\Return_;
use 
PhpParser\NodeVisitorAbstract;
use 
Psy\CodeCleaner\NoReturnValue;
use 
Psy\Command\TimeitCommand;

/**
 * A node visitor for instrumenting code to be executed by the `timeit` command.
 *
 * Injects `TimeitCommand::markStart()` at the start of code to be executed, and
 * `TimeitCommand::markEnd()` at the end, and on top-level return statements.
 */
class TimeitVisitor extends NodeVisitorAbstract
{
    private 
$functionDepth;

    
/**
     * {@inheritdoc}
     *
     * @return Node[]|null Array of nodes
     */
    
public function beforeTraverse(array $nodes)
    {
        
$this->functionDepth 0;
    }

    
/**
     * {@inheritdoc}
     *
     * @return int|Node|null Replacement node (or special return value)
     */
    
public function enterNode(Node $node)
    {
        
// keep track of nested function-like nodes, because they can have
        // returns statements... and we don't want to call markEnd for those.
        
if ($node instanceof FunctionLike) {
            
$this->functionDepth++;

            return;
        }

        
// replace any top-level `return` statements with a `markEnd` call
        
if ($this->functionDepth === && $node instanceof Return_) {
            return new 
Return_($this->getEndCall($node->expr), $node->getAttributes());
        }
    }

    
/**
     * {@inheritdoc}
     *
     * @return int|Node|Node[]|null Replacement node (or special return value)
     */
    
public function leaveNode(Node $node)
    {
        if (
$node instanceof FunctionLike) {
            
$this->functionDepth--;
        }
    }

    
/**
     * {@inheritdoc}
     *
     * @return Node[]|null Array of nodes
     */
    
public function afterTraverse(array $nodes)
    {
        
// prepend a `markStart` call
        
\array_unshift($nodes$this->maybeExpression($this->getStartCall()));

        
// append a `markEnd` call (wrapping the final node, if it's an expression)
        
$last $nodes[\count($nodes) - 1];
        if (
$last instanceof Expr) {
            
\array_pop($nodes);
            
$nodes[] = $this->getEndCall($last);
        } elseif (
$last instanceof Expression) {
            
\array_pop($nodes);
            
$nodes[] = new Expression($this->getEndCall($last->expr), $last->getAttributes());
        } elseif (
$last instanceof Return_) {
            
// nothing to do here, we're already ending with a return call
        
} else {
            
$nodes[] = $this->maybeExpression($this->getEndCall());
        }

        return 
$nodes;
    }

    
/**
     * Get PhpParser AST nodes for a `markStart` call.
     *
     * @return \PhpParser\Node\Expr\StaticCall
     */
    
private function getStartCall(): StaticCall
    
{
        return new 
StaticCall(new FullyQualifiedName(TimeitCommand::class), 'markStart');
    }

    
/**
     * Get PhpParser AST nodes for a `markEnd` call.
     *
     * Optionally pass in a return value.
     *
     * @param Expr|null $arg
     */
    
private function getEndCall(Expr $arg null): StaticCall
    
{
        if (
$arg === null) {
            
$arg NoReturnValue::create();
        }

        return new 
StaticCall(new FullyQualifiedName(TimeitCommand::class), 'markEnd', [new Arg($arg)]);
    }

    
/**
     * Compatibility shim for PHP Parser 3.x.
     *
     * Wrap $expr in a PhpParser\Node\Stmt\Expression if the class exists.
     *
     * @param \PhpParser\Node $expr
     * @param array           $attrs
     *
     * @return \PhpParser\Node\Expr|\PhpParser\Node\Stmt\Expression
     */
    
private function maybeExpression(Node $expr, array $attrs = [])
    {
        return 
\class_exists(Expression::class) ? new Expression($expr$attrs) : $expr;
    }
}

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