!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/laravel/framework/src/Illuminate/Console/Concerns/   drwxrwxrwx
Free 13.13 GB of 57.97 GB (22.66%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Illuminate\Console\Concerns;

use 
Closure;
use 
Illuminate\Contracts\Console\PromptsForMissingInput as PromptsForMissingInputContract;
use 
Symfony\Component\Console\Input\InputInterface;
use 
Symfony\Component\Console\Output\OutputInterface;

use function 
Laravel\Prompts\text;

trait 
PromptsForMissingInput
{
    
/**
     * Interact with the user before validating the input.
     *
     * @param  \Symfony\Component\Console\Input\InputInterface  $input
     * @param  \Symfony\Component\Console\Output\OutputInterface  $output
     * @return void
     */
    
protected function interact(InputInterface $inputOutputInterface $output)
    {
        
parent::interact($input$output);

        if (
$this instanceof PromptsForMissingInputContract) {
            
$this->promptForMissingArguments($input$output);
        }
    }

    
/**
     * Prompt the user for any missing arguments.
     *
     * @param  \Symfony\Component\Console\Input\InputInterface  $input
     * @param  \Symfony\Component\Console\Output\OutputInterface  $output
     * @return void
     */
    
protected function promptForMissingArguments(InputInterface $inputOutputInterface $output)
    {
        
$prompted collect($this->getDefinition()->getArguments())
            ->
filter(fn ($argument) => $argument->isRequired() && is_null($input->getArgument($argument->getName())))
            ->
filter(fn ($argument) => $argument->getName() !== 'command')
            ->
each(function ($argument) use ($input) {
                
$label $this->promptForMissingArgumentsUsing()[$argument->getName()] ??
                    
'What is '.lcfirst($argument->getDescription() ?: ('the '.$argument->getName())).'?';

                if (
$label instanceof Closure) {
                    return 
$input->setArgument($argument->getName(), $label());
                }

                if (
is_array($label)) {
                    [
$label$placeholder] = $label;
                }

                
$input->setArgument($argument->getName(), text(
                    
label$label,
                    
placeholder$placeholder ?? '',
                    
validate: fn ($value) => empty($value) ? "The {$argument->getName()} is required." null,
                ));
            })
            ->
isNotEmpty();

        if (
$prompted) {
            
$this->afterPromptingForMissingArguments($input$output);
        }
    }

    
/**
     * Prompt for missing input arguments using the returned questions.
     *
     * @return array
     */
    
protected function promptForMissingArgumentsUsing()
    {
        return [];
    }

    
/**
     * Perform actions after the user was prompted for missing arguments.
     *
     * @param  \Symfony\Component\Console\Input\InputInterface  $input
     * @param  \Symfony\Component\Console\Output\OutputInterface  $output
     * @return void
     */
    
protected function afterPromptingForMissingArguments(InputInterface $inputOutputInterface $output)
    {
        
//
    
}

    
/**
     * Whether the input contains any options that differ from the default values.
     *
     * @param  \Symfony\Component\Console\Input\InputInterface  $input
     * @return bool
     */
    
protected function didReceiveOptions(InputInterface $input)
    {
        return 
collect($this->getDefinition()->getOptions())
            ->
reject(fn ($option) => $input->getOption($option->getName()) === $option->getDefault())
            ->
isNotEmpty();
    }
}

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