!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_led/php/vendor/symfony/console/Tests/Helper/   drwxrwxr-x
Free 15.68 GB of 61.93 GB (25.31%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     ProcessHelperTest.php (4.8 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Console\Tests\Helper;

use 
PHPUnit\Framework\TestCase;
use 
Symfony\Component\Console\Helper\DebugFormatterHelper;
use 
Symfony\Component\Console\Helper\HelperSet;
use 
Symfony\Component\Console\Output\StreamOutput;
use 
Symfony\Component\Console\Helper\ProcessHelper;
use 
Symfony\Component\Process\Process;
use 
Symfony\Component\Process\ProcessBuilder;

class 
ProcessHelperTest extends TestCase
{
    
/**
     * @dataProvider provideCommandsAndOutput
     */
    
public function testVariousProcessRuns($expected$cmd$verbosity$error)
    {
        
$helper = new ProcessHelper();
        
$helper->setHelperSet(new HelperSet(array(new DebugFormatterHelper())));
        
$output $this->getOutputStream($verbosity);
        
$helper->run($output$cmd$error);
        
$this->assertEquals($expected$this->getOutput($output));
    }

    public function 
testPassedCallbackIsExecuted()
    {
        
$helper = new ProcessHelper();
        
$helper->setHelperSet(new HelperSet(array(new DebugFormatterHelper())));
        
$output $this->getOutputStream(StreamOutput::VERBOSITY_NORMAL);

        
$executed false;
        
$callback = function () use (&$executed) { $executed true; };

        
$helper->run($output'php -r "echo 42;"'null$callback);
        
$this->assertTrue($executed);
    }

    public function 
provideCommandsAndOutput()
    {
        
$successOutputVerbose = <<<'EOT'
  RUN  php -r "echo 42;"
  RES  Command ran successfully

EOT;
        
$successOutputDebug = <<<'EOT'
  RUN  php -r "echo 42;"
  OUT  42
  RES  Command ran successfully

EOT;
        
$successOutputDebugWithTags = <<<'EOT'
  RUN  php -r "echo '<info>42</info>';"
  OUT  <info>42</info>
  RES  Command ran successfully

EOT;
        
$successOutputProcessDebug = <<<'EOT'
  RUN  'php' '-r' 'echo 42;'
  OUT  42
  RES  Command ran successfully

EOT;
        
$syntaxErrorOutputVerbose = <<<'EOT'
  RUN  php -r "fwrite(STDERR, 'error message');usleep(50000);fwrite(STDOUT, 'out message');exit(252);"
  RES  252 Command did not run successfully

EOT;
        
$syntaxErrorOutputDebug = <<<'EOT'
  RUN  php -r "fwrite(STDERR, 'error message');usleep(500000);fwrite(STDOUT, 'out message');exit(252);"
  ERR  error message
  OUT  out message
  RES  252 Command did not run successfully

EOT;

        
$errorMessage 'An error occurred';
        
$args = new ProcessBuilder(array('php''-r''echo 42;'));
        
$args $args->getProcess()->getCommandLine();
        
$successOutputProcessDebug str_replace("'php' '-r' 'echo 42;'"$args$successOutputProcessDebug);

        return array(
            array(
'''php -r "echo 42;"'StreamOutput::VERBOSITY_VERBOSEnull),
            array(
$successOutputVerbose'php -r "echo 42;"'StreamOutput::VERBOSITY_VERY_VERBOSEnull),
            array(
$successOutputDebug'php -r "echo 42;"'StreamOutput::VERBOSITY_DEBUGnull),
            array(
$successOutputDebugWithTags'php -r "echo \'<info>42</info>\';"'StreamOutput::VERBOSITY_DEBUGnull),
            array(
'''php -r "syntax error"'StreamOutput::VERBOSITY_VERBOSEnull),
            array(
$syntaxErrorOutputVerbose'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"'StreamOutput::VERBOSITY_VERY_VERBOSEnull),
            array(
$syntaxErrorOutputDebug'php -r "fwrite(STDERR, \'error message\');usleep(500000);fwrite(STDOUT, \'out message\');exit(252);"'StreamOutput::VERBOSITY_DEBUGnull),
            array(
$errorMessage.PHP_EOL'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"'StreamOutput::VERBOSITY_VERBOSE$errorMessage),
            array(
$syntaxErrorOutputVerbose.$errorMessage.PHP_EOL'php -r "fwrite(STDERR, \'error message\');usleep(50000);fwrite(STDOUT, \'out message\');exit(252);"'StreamOutput::VERBOSITY_VERY_VERBOSE$errorMessage),
            array(
$syntaxErrorOutputDebug.$errorMessage.PHP_EOL'php -r "fwrite(STDERR, \'error message\');usleep(500000);fwrite(STDOUT, \'out message\');exit(252);"'StreamOutput::VERBOSITY_DEBUG$errorMessage),
            array(
$successOutputProcessDebug, array('php''-r''echo 42;'), StreamOutput::VERBOSITY_DEBUGnull),
            array(
$successOutputDebug, new Process('php -r "echo 42;"'), StreamOutput::VERBOSITY_DEBUGnull),
        );
    }

    private function 
getOutputStream($verbosity)
    {
        return new 
StreamOutput(fopen('php://memory''r+'false), $verbosityfalse);
    }

    private function 
getOutput(StreamOutput $output)
    {
        
rewind($output->getStream());

        return 
stream_get_contents($output->getStream());
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.2769 ]--