!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.22 (Debian). PHP/5.6.36 

uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 

uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) 

Safe-mode: OFF (not secure)

/home/h33678/data/www/it-man.ztu.edu.ua/src/vendor/symfony/console/Tests/Helper/   drwxr-xr-x
Free 116.6 GB of 200.55 GB (58.14%)
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.64 KB)      -rw-r--r--
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 
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;

class 
ProcessHelperTest extends \PHPUnit_Framework_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';
        if (
'\\' === DIRECTORY_SEPARATOR) {
            
$successOutputProcessDebug str_replace("'"'"'$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 ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.0394 ]--