!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.25 GB of 57.97 GB (22.85%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     HomeCommand.php (5.37 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\Package\CompletePackageInterface;
use 
Composer\Repository\RepositoryInterface;
use 
Composer\Repository\RootPackageRepository;
use 
Composer\Repository\RepositoryFactory;
use 
Composer\Util\Platform;
use 
Composer\Util\ProcessExecutor;
use 
Symfony\Component\Console\Input\InputArgument;
use 
Symfony\Component\Console\Input\InputOption;
use 
Symfony\Component\Console\Input\InputInterface;
use 
Symfony\Component\Console\Output\OutputInterface;

/**
 * @author Robert Schönthal <seroscho@googlemail.com>
 */
class HomeCommand extends BaseCommand
{
    
/**
     * {@inheritDoc}
     */
    
protected function configure()
    {
        
$this
            
->setName('browse')
            ->
setAliases(array('home'))
            ->
setDescription('Opens the package\'s repository URL or homepage in your browser.')
            ->
setDefinition(array(
                new 
InputArgument('packages'InputArgument::IS_ARRAY'Package(s) to browse to.'),
                new 
InputOption('homepage''H'InputOption::VALUE_NONE'Open the homepage instead of the repository URL.'),
                new 
InputOption('show''s'InputOption::VALUE_NONE'Only show the homepage or repository URL.'),
            ))
            ->
setHelp(
                <<<EOT
The home command opens or shows a package's repository URL or
homepage in your default browser.

To open the homepage by default, use -H or --homepage.
To show instead of open the repository or homepage URL, use -s or --show.

Read more at https://getcomposer.org/doc/03-cli.md#browse-home
EOT
            );
    }

    
/**
     * {@inheritDoc}
     */
    
protected function execute(InputInterface $inputOutputInterface $output)
    {
        
$repos $this->initializeRepos();
        
$io $this->getIO();
        
$return 0;

        
$packages $input->getArgument('packages');
        if (!
$packages) {
            
$io->writeError('No package specified, opening homepage for the root package');
            
$packages = array($this->getComposer()->getPackage()->getName());
        }

        foreach (
$packages as $packageName) {
            
$handled false;
            
$packageExists false;
            foreach (
$repos as $repo) {
                foreach (
$repo->findPackages($packageName) as $package) {
                    
$packageExists true;
                    if (
$package instanceof CompletePackageInterface && $this->handlePackage($package$input->getOption('homepage'), $input->getOption('show'))) {
                        
$handled true;
                        break 
2;
                    }
                }
            }

            if (!
$packageExists) {
                
$return 1;
                
$io->writeError('<warning>Package '.$packageName.' not found</warning>');
            }

            if (!
$handled) {
                
$return 1;
                
$io->writeError('<warning>'.($input->getOption('homepage') ? 'Invalid or missing homepage' 'Invalid or missing repository URL').' for '.$packageName.'</warning>');
            }
        }

        return 
$return;
    }

    private function 
handlePackage(CompletePackageInterface $package$showHomepage$showOnly)
    {
        
$support $package->getSupport();
        
$url = isset($support['source']) ? $support['source'] : $package->getSourceUrl();
        if (!
$url || $showHomepage) {
            
$url $package->getHomepage();
        }

        if (!
$url || !filter_var($urlFILTER_VALIDATE_URL)) {
            return 
false;
        }

        if (
$showOnly) {
            
$this->getIO()->write(sprintf('<info>%s</info>'$url));
        } else {
            
$this->openBrowser($url);
        }

        return 
true;
    }

    
/**
     * opens a url in your system default browser
     *
     * @param string $url
     */
    
private function openBrowser($url)
    {
        
$url ProcessExecutor::escape($url);

        
$process = new ProcessExecutor($this->getIO());
        if (
Platform::isWindows()) {
            return 
$process->execute('start "web" explorer "' $url '"'$output);
        }

        
$linux $process->execute('which xdg-open'$output);
        
$osx $process->execute('which open'$output);

        if (
=== $linux) {
            
$process->execute('xdg-open ' $url$output);
        } elseif (
=== $osx) {
            
$process->execute('open ' $url$output);
        } else {
            
$this->getIO()->writeError('No suitable browser opening command found, open yourself: ' $url);
        }
    }

    
/**
     * Initializes repositories
     *
     * Returns an array of repos in order they should be checked in
     *
     * @return RepositoryInterface[]
     */
    
private function initializeRepos()
    {
        
$composer $this->getComposer(false);

        if (
$composer) {
            return 
array_merge(
                array(new 
RootPackageRepository($composer->getPackage())), // root package
                
array($composer->getRepositoryManager()->getLocalRepository()), // installed packages
                
$composer->getRepositoryManager()->getRepositories() // remotes
            
);
        }

        return 
RepositoryFactory::defaultRepos($this->getIO());
    }
}

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