!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/classpreloader/classpreloader/src/   drwxr-xr-x
Free 117.1 GB of 200.55 GB (58.39%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

/*
 * This file is part of Class Preloader.
 *
 * (c) Graham Campbell <graham@alt-three.com>
 * (c) Michael Dowling <mtdowling@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace ClassPreloader;

use 
ClassPreloader\Parser\NodeTraverser;
use 
PhpParser\Node\Stmt\Namespace_ as NamespaceNode;
use 
PhpParser\Parser;
use 
PhpParser\PrettyPrinter\Standard as PrettyPrinter;
use 
RuntimeException;

/**
 * This is the class preloader class.
 *
 * This is the main point of entry for interacting with this package.
 */
class ClassPreloader
{
    
/**
     * The printer.
     *
     * @var \PhpParser\PrettyPrinter\Standard
     */
    
protected $printer;

    
/**
     * The parser.
     *
     * @var \PhpParser\Parser
     */
    
protected $parser;

    
/**
     * The traverser.
     *
     * @var \ClassPreloader\Parser\NodeTraverser
     */
    
protected $traverser;

    
/**
     * Create a new class preloader instance.
     *
     * @param \PhpParser\PrettyPrinter\Standard    $printer
     * @param \PhpParser\Parser                    $parser
     * @param \ClassPreloader\Parser\NodeTraverser $traverser
     *
     * @return void
     */
    
public function __construct(PrettyPrinter $printerParser $parserNodeTraverser $traverser)
    {
        
$this->printer $printer;
        
$this->parser $parser;
        
$this->traverser $traverser;
    }

    
/**
     * Prepare the output file and directory.
     *
     * @param string $output
     * @param bool   $strict
     *
     * @throws \RuntimeException
     *
     * @return resource
     */
    
public function prepareOutput($output$strict false)
    {
        if (
$strict && version_compare(PHP_VERSION'7') < 1) {
            throw new 
RuntimeException('Strict mode requires PHP 7 or greater.');
        }

        
$dir dirname($output);

        if (!
is_dir($dir) && !mkdir($dir0777true)) {
            throw new 
RuntimeException("Unable to create directory $dir.");
        }

        
$handle fopen($output'w');

        if (!
$handle) {
            throw new 
RuntimeException("Unable to open $output for writing.");
        }

        if (
$strict) {
            
fwrite($handle"<?php declare(strict_types=1);\n");
        } else {
            
fwrite($handle"<?php\n");
        }

        return 
$handle;
    }

    
/**
     * Get a pretty printed string of code from a file while applying visitors.
     *
     * @param string $file
     *
     * @throws \RuntimeException
     *
     * @return string
     */
    
public function getCode($file$comments true)
    {
        if (!
is_string($file) || empty($file)) {
            throw new 
RuntimeException('Invalid filename provided.');
        }

        if (!
is_readable($file)) {
            throw new 
RuntimeException("Cannot open $file for reading.");
        }

        if (
$comments) {
            
$content file_get_contents($file);
        } else {
            
$content php_strip_whitespace($file);
        }

        
$parsed $this->parser->parse($content);
        
$stmts $this->traverser->traverseFile($parsed$file);
        
$pretty $this->printer->prettyPrint($stmts);

        if (
substr($pretty30) === '<?php declare(strict_types=1);' || substr($pretty30) === "<?php\ndeclare(strict_types=1);") {
            
$pretty substr($pretty32);
        } elseif (
substr($pretty31) === "<?php\r\ndeclare(strict_types=1);") {
            
$pretty substr($pretty33);
        } elseif (
substr($pretty5) === '<?php') {
            
$pretty substr($pretty7);
        }

        return 
$this->getCodeWrappedIntoNamespace($parsed$pretty);
    }

    
/**
     * Wrap the code into a namespace.
     *
     * @param array  $parsed
     * @param string $pretty
     *
     * @return string
     */
    
protected function getCodeWrappedIntoNamespace(array $parsed$pretty)
    {
        if (
$this->parsedCodeHasNamespaces($parsed)) {
            
$pretty preg_replace('/^\s*(namespace.*);/i''${1} {'$pretty1)."\n}\n";
        } else {
            
$pretty sprintf("namespace {\n%s\n}\n"$pretty);
        }

        return 
preg_replace('/(?<!.)[\r\n]+/'''$pretty);
    }

    
/**
     * Check parsed code for having namespaces.
     *
     * @param array $parsed
     *
     * @return bool
     */
    
protected function parsedCodeHasNamespaces(array $parsed)
    {
        
// Namespaces can only be on first level in the code,
        // so we make only check on it.
        
$node array_filter(
            
$parsed,
            function (
$value) {
                return 
$value instanceof NamespaceNode;
            }
        );

        return !empty(
$node);
    }
}

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