���Root Mod By V1rus_Alfa
User / IP
:
216.73.217.78
Host / Server
:
195.214.235.115 / npln.ir
System
:
Linux damavand.pws-dns.net 5.14.0-503.35.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 4 05:23:43 EDT 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home2
/
cutunixc
/
repositories
/
npln
/
vendor
/
psy
/
psysh
/
src
/
Readline
/
Interactive
/
Viewing: InteractiveSession.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\Readline\Interactive; /** * Owns terminal lifecycle for interactive readline sessions. */ class InteractiveSession { private Terminal $terminal; private bool $active = false; private bool $shutdownRegistered = false; private bool $bracketedPasteEnabled = false; public function __construct(Terminal $terminal) { $this->terminal = $terminal; } /** * Start interactive terminal lifecycle. * * @throws \RuntimeException if raw mode cannot be enabled */ public function start(): void { if ($this->active) { return; } $this->registerShutdownHandler(); if (!$this->terminal->enableRawMode()) { throw new \RuntimeException('Unable to enable raw mode for interactive readline.'); } if ($this->bracketedPasteEnabled) { $this->terminal->enableBracketedPaste(); } $this->active = true; } /** * Stop interactive terminal lifecycle. */ public function stop(): void { if (!$this->active) { return; } if ($this->terminal->isBracketedPasteEnabled()) { $this->terminal->disableBracketedPaste(); } $this->terminal->disableRawMode(); $this->active = false; } /** * Enable or disable bracketed paste mode for the active session. */ public function setUseBracketedPaste(bool $enabled): void { $this->bracketedPasteEnabled = $enabled; if (!$this->active) { return; } if ($enabled) { $this->terminal->enableBracketedPaste(); } else { $this->terminal->disableBracketedPaste(); } } /** * Determine whether the session is active. */ public function isActive(): bool { return $this->active; } /** * Register a shutdown function to ensure the terminal is restored on exit. */ private function registerShutdownHandler(): void { if ($this->shutdownRegistered) { return; } \register_shutdown_function([$this, 'stop']); $this->shutdownRegistered = true; } /** * Stop the session on destruction. */ public function __destruct() { $this->stop(); } }
Coded With 💗 by
0x6ick Mod By V1rus_Alfa