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


Viewing file:     LockTransaction.php (4.72 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\DependencyResolver;

use 
Composer\Package\AliasPackage;
use 
Composer\Package\RootAliasPackage;

/**
 * @author Nils Adermann <naderman@naderman.de>
 * @internal
 */
class LockTransaction extends Transaction
{
    
/**
     * packages in current lock file, platform repo or otherwise present
     * @var array
     */
    
protected $presentMap;

    
/**
     * Packages which cannot be mapped, platform repo, root package, other fixed repos
     * @var array
     */
    
protected $unlockableMap;

    
/**
     * @var array
     */
    
protected $resultPackages;

    public function 
__construct(Pool $pool$presentMap$unlockableMap$decisions)
    {
        
$this->presentMap $presentMap;
        
$this->unlockableMap $unlockableMap;

        
$this->setResultPackages($pool$decisions);
        
parent::__construct($this->presentMap$this->resultPackages['all']);
    }

    
// TODO make this a bit prettier instead of the two text indexes?
    
public function setResultPackages(Pool $poolDecisions $decisions)
    {
        
$this->resultPackages = array('all' => array(), 'non-dev' => array(), 'dev' => array());
        foreach (
$decisions as $i => $decision) {
            
$literal $decision[Decisions::DECISION_LITERAL];

            if (
$literal 0) {
                
$package $pool->literalToPackage($literal);

                
$this->resultPackages['all'][] = $package;
                if (!isset(
$this->unlockableMap[$package->id])) {
                    
$this->resultPackages['non-dev'][] = $package;
                }
            }
        }
    }

    public function 
setNonDevPackages(LockTransaction $extractionResult)
    {
        
$packages $extractionResult->getNewLockPackages(false);

        
$this->resultPackages['dev'] = $this->resultPackages['non-dev'];
        
$this->resultPackages['non-dev'] = array();

        foreach (
$packages as $package) {
            foreach (
$this->resultPackages['dev'] as $i => $resultPackage) {
                
// TODO this comparison is probably insufficient, aliases, what about modified versions? I guess they aren't possible?
                
if ($package->getName() == $resultPackage->getName()) {
                    
$this->resultPackages['non-dev'][] = $resultPackage;
                    unset(
$this->resultPackages['dev'][$i]);
                }
            }
        }
    }

    
// TODO additionalFixedRepository needs to be looked at here as well?
    
public function getNewLockPackages($devMode$updateMirrors false)
    {
        
$packages = array();
        foreach (
$this->resultPackages[$devMode 'dev' 'non-dev'] as $package) {
            if (!(
$package instanceof AliasPackage) && !($package instanceof RootAliasPackage)) {
                
// if we're just updating mirrors we need to reset references to the same as currently "present" packages' references to keep the lock file as-is
                // we do not reset references if the currently present package didn't have any, or if the type of VCS has changed
                
if ($updateMirrors && !isset($this->presentMap[spl_object_hash($package)])) {
                    foreach (
$this->presentMap as $presentPackage) {
                        if (
$package->getName() == $presentPackage->getName() &&
                            
$package->getVersion() == $presentPackage->getVersion() &&
                            
$presentPackage->getSourceReference() &&
                            
$presentPackage->getSourceType() === $package->getSourceType()
                        ) {
                            
$package->setSourceDistReferences($presentPackage->getSourceReference());
                        }
                    }
                }
                
$packages[] = $package;
            }
        }

        return 
$packages;
    }

    
/**
     * Checks which of the given aliases from composer.json are actually in use for the lock file
     */
    
public function getAliases($aliases)
    {
        
$usedAliases = array();

        foreach (
$this->resultPackages['all'] as $package) {
            if (
$package instanceof AliasPackage) {
                foreach (
$aliases as $index => $alias) {
                    if (
$alias['package'] === $package->getName()) {
                        
$usedAliases[] = $alias;
                        unset(
$aliases[$index]);
                    }
                }
            }
        }

        
usort($usedAliases, function ($a$b) {
            return 
strcmp($a['package'], $b['package']);
        });

        return 
$usedAliases;
    }
}

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