403Webshell
Server IP : 138.197.107.151  /  Your IP : 216.73.217.7
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux BloxBy-Builder 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64
User : wpbetasites_mrakzqskir ( 1022)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/silversharkadmindev/vendor/psy/psysh/src/Shell/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/silversharkadmindev/vendor/psy/psysh/src/Shell/PendingInputState.php
<?php

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

namespace Psy\Shell;

use Psy\Input\SilentInput;

/**
 * Tracks pending code entered during the current shell session.
 */
class PendingInputState
{
    /** @var string|false */
    private $pendingCode = false;
    private array $pendingCodeBuffer = [];
    private bool $pendingCodeBufferOpen = false;
    private array $pendingCodeStack = [];

    public function hasCode(): bool
    {
        return $this->pendingCodeBuffer !== [];
    }

    public function hasValidCode(): bool
    {
        return $this->hasCode() && !$this->pendingCodeBufferOpen && $this->pendingCode !== false;
    }

    public function pushCurrentCode(): void
    {
        $this->pendingCodeStack[] = [$this->pendingCodeBuffer, $this->pendingCodeBufferOpen, $this->pendingCode];
    }

    public function restorePreviousCode(): void
    {
        $this->clear();

        if ($this->pendingCodeStack === []) {
            return;
        }

        [$this->pendingCodeBuffer, $this->pendingCodeBufferOpen, $this->pendingCode] = \array_pop($this->pendingCodeStack);
    }

    public function clear(): void
    {
        $this->pendingCodeBuffer = [];
        $this->pendingCodeBufferOpen = false;
        $this->pendingCode = false;
    }

    public function appendLine(string $code, bool $silent): string
    {
        $trimmed = \rtrim($code);
        if (\substr($trimmed, -1) === '\\') {
            $this->pendingCodeBufferOpen = true;
            $code = \substr($trimmed, 0, -1);
        } else {
            $this->pendingCodeBufferOpen = false;
        }

        $this->pendingCodeBuffer[] = $silent ? new SilentInput($code) : $code;

        return $code;
    }

    /**
     * @return string|false
     */
    public function getPendingCode()
    {
        return $this->pendingCode;
    }

    /**
     * @param string|false $pendingCode
     */
    public function setPendingCode($pendingCode): void
    {
        $this->pendingCode = $pendingCode;
    }

    public function getPendingCodeBuffer(): array
    {
        return $this->pendingCodeBuffer;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit