!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)

/uploads/script/vendor/composer/composer/src/Composer/Command/   drwxr-xr-x
Free 13.21 GB of 57.97 GB (22.79%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

/*
 * This file is part of Composer.
 *
 * (c) Nils Adermann <naderman@naderman.de>
 *     Jordi Boggiano <j.boggiano@seld.be>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Composer\Command;

use 
Composer\Composer;
use 
Composer\Config;
use 
Composer\Console\Application;
use 
Composer\Factory;
use 
Composer\IO\IOInterface;
use 
Composer\IO\NullIO;
use 
Composer\Plugin\PreCommandRunEvent;
use 
Composer\Package\Version\VersionParser;
use 
Composer\Plugin\PluginEvents;
use 
Symfony\Component\Console\Helper\Table;
use 
Symfony\Component\Console\Input\InputInterface;
use 
Symfony\Component\Console\Output\OutputInterface;
use 
Symfony\Component\Console\Command\Command;

/**
 * Base class for Composer commands
 *
 * @method Application getApplication()
 *
 * @author Ryan Weaver <ryan@knplabs.com>
 * @author Konstantin Kudryashov <ever.zet@gmail.com>
 */
abstract class BaseCommand extends Command
{
    
/**
     * @var Composer|null
     */
    
private $composer;

    
/**
     * @var IOInterface
     */
    
private $io;

    
/**
     * @param  bool              $required
     * @param  bool|null         $disablePlugins
     * @throws \RuntimeException
     * @return Composer|null
     */
    
public function getComposer($required true$disablePlugins null)
    {
        if (
null === $this->composer) {
            
$application $this->getApplication();
            if (
$application instanceof Application) {
                
/* @var $application    Application */
                
$this->composer $application->getComposer($required$disablePlugins);
            } elseif (
$required) {
                throw new 
\RuntimeException(
                    
'Could not create a Composer\Composer instance, you must inject '.
                    
'one if this command is not used with a Composer\Console\Application instance'
                
);
            }
        }

        return 
$this->composer;
    }

    
/**
     * @param Composer $composer
     */
    
public function setComposer(Composer $composer)
    {
        
$this->composer $composer;
    }

    
/**
     * Removes the cached composer instance
     */
    
public function resetComposer()
    {
        
$this->composer null;
        
$this->getApplication()->resetComposer();
    }

    
/**
     * Whether or not this command is meant to call another command.
     *
     * This is mainly needed to avoid duplicated warnings messages.
     *
     * @return bool
     */
    
public function isProxyCommand()
    {
        return 
false;
    }

    
/**
     * @return IOInterface
     */
    
public function getIO()
    {
        if (
null === $this->io) {
            
$application $this->getApplication();
            if (
$application instanceof Application) {
                
/* @var $application    Application */
                
$this->io $application->getIO();
            } else {
                
$this->io = new NullIO();
            }
        }

        return 
$this->io;
    }

    
/**
     * @param IOInterface $io
     */
    
public function setIO(IOInterface $io)
    {
        
$this->io $io;
    }

    
/**
     * {@inheritDoc}
     */
    
protected function initialize(InputInterface $inputOutputInterface $output)
    {
        
// initialize a plugin-enabled Composer instance, either local or global
        
$disablePlugins $input->hasParameterOption('--no-plugins');
        
$composer $this->getComposer(false$disablePlugins);
        if (
null === $composer) {
            
$composer Factory::createGlobal($this->getIO(), $disablePlugins);
        }
        if (
$composer) {
            
$preCommandRunEvent = new PreCommandRunEvent(PluginEvents::PRE_COMMAND_RUN$input$this->getName());
            
$composer->getEventDispatcher()->dispatch($preCommandRunEvent->getName(), $preCommandRunEvent);
        }

        if (
true === $input->hasParameterOption(array('--no-ansi')) && $input->hasOption('no-progress')) {
            
$input->setOption('no-progress'true);
        }

        
parent::initialize($input$output);
    }

    
/**
     * Returns preferSource and preferDist values based on the configuration.
     *
     * @param Config         $config
     * @param InputInterface $input
     * @param bool           $keepVcsRequiresPreferSource
     *
     * @return bool[] An array composed of the preferSource and preferDist values
     */
    
protected function getPreferredInstallOptions(Config $configInputInterface $input$keepVcsRequiresPreferSource false)
    {
        
$preferSource false;
        
$preferDist false;

        switch (
$config->get('preferred-install')) {
            case 
'source':
                
$preferSource true;
                break;
            case 
'dist':
                
$preferDist true;
                break;
            case 
'auto':
            default:
                
// noop
                
break;
        }

        if (
$input->getOption('prefer-source') || $input->getOption('prefer-dist') || ($keepVcsRequiresPreferSource && $input->hasOption('keep-vcs') && $input->getOption('keep-vcs'))) {
            
$preferSource $input->getOption('prefer-source') || ($keepVcsRequiresPreferSource && $input->hasOption('keep-vcs') && $input->getOption('keep-vcs'));
            
$preferDist = (bool) $input->getOption('prefer-dist');
        }

        return array(
$preferSource$preferDist);
    }

    protected function 
formatRequirements(array $requirements)
    {
        
$requires = array();
        
$requirements $this->normalizeRequirements($requirements);
        foreach (
$requirements as $requirement) {
            if (!isset(
$requirement['version'])) {
                throw new 
\UnexpectedValueException('Option '.$requirement['name'] .' is missing a version constraint, use e.g. '.$requirement['name'].':^1.0');
            }
            
$requires[$requirement['name']] = $requirement['version'];
        }

        return 
$requires;
    }

    protected function 
normalizeRequirements(array $requirements)
    {
        
$parser = new VersionParser();

        return 
$parser->parseNameVersionPairs($requirements);
    }

    protected function 
renderTable(array $tableOutputInterface $output)
    {
        
$renderer = new Table($output);
        
$renderer->setStyle('compact');
        
$rendererStyle $renderer->getStyle();
        if (
method_exists($rendererStyle'setVerticalBorderChars')) {
            
$rendererStyle->setVerticalBorderChars('');
        } else {
            
$rendererStyle->setVerticalBorderChar('');
        }
        
$rendererStyle->setCellRowContentFormat('%s  ');
        
$renderer->setRows($table)->render();
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0057 ]--