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


Viewing file:     PerforceDriver.php (3.76 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\Vcs;

use 
Composer\Config;
use 
Composer\Cache;
use 
Composer\IO\IOInterface;
use 
Composer\Util\ProcessExecutor;
use 
Composer\Util\Perforce;

/**
 * @author Matt Whittom <Matt.Whittom@veteransunited.com>
 */
class PerforceDriver extends VcsDriver
{
    protected 
$depot;
    protected 
$branch;
    
/** @var Perforce */
    
protected $perforce;

    
/**
     * {@inheritDoc}
     */
    
public function initialize()
    {
        
$this->depot $this->repoConfig['depot'];
        
$this->branch '';
        if (!empty(
$this->repoConfig['branch'])) {
            
$this->branch $this->repoConfig['branch'];
        }

        
$this->initPerforce($this->repoConfig);
        
$this->perforce->p4Login();
        
$this->perforce->checkStream();

        
$this->perforce->writeP4ClientSpec();
        
$this->perforce->connectClient();

        return 
true;
    }

    private function 
initPerforce($repoConfig)
    {
        if (!empty(
$this->perforce)) {
            return;
        }

        if (!
Cache::isUsable($this->config->get('cache-vcs-dir'))) {
            throw new 
\RuntimeException('PerforceDriver requires a usable cache directory, and it looks like you set it to be disabled');
        }

        
$repoDir $this->config->get('cache-vcs-dir') . '/' $this->depot;
        
$this->perforce Perforce::create($repoConfig$this->getUrl(), $repoDir$this->process$this->io);
    }

    
/**
     * {@inheritdoc}
     */
    
public function getFileContent($file$identifier)
    {
        return 
$this->perforce->getFileContent($file$identifier);
    }

    
/**
     * {@inheritdoc}
     */
    
public function getChangeDate($identifier)
    {
        return 
null;
    }

    
/**
     * {@inheritDoc}
     */
    
public function getRootIdentifier()
    {
        return 
$this->branch;
    }

    
/**
     * {@inheritDoc}
     */
    
public function getBranches()
    {
        return 
$this->perforce->getBranches();
    }

    
/**
     * {@inheritDoc}
     */
    
public function getTags()
    {
        return 
$this->perforce->getTags();
    }

    
/**
     * {@inheritDoc}
     */
    
public function getDist($identifier)
    {
        return 
null;
    }

    
/**
     * {@inheritDoc}
     */
    
public function getSource($identifier)
    {
        return array(
            
'type' => 'perforce',
            
'url' => $this->repoConfig['url'],
            
'reference' => $identifier,
            
'p4user' => $this->perforce->getUser(),
        );
    }

    
/**
     * {@inheritDoc}
     */
    
public function getUrl()
    {
        return 
$this->url;
    }

    
/**
     * {@inheritDoc}
     */
    
public function hasComposerFile($identifier)
    {
        
$composerInfo $this->perforce->getComposerInformation('//' $this->depot '/' $identifier);

        return !empty(
$composerInfo);
    }

    
/**
     * {@inheritDoc}
     */
    
public function getContents($url)
    {
        return 
false;
    }

    
/**
     * {@inheritDoc}
     */
    
public static function supports(IOInterface $ioConfig $config$url$deep false)
    {
        if (
$deep || preg_match('#\b(perforce|p4)\b#i'$url)) {
            return 
Perforce::checkServerExists($url, new ProcessExecutor($io));
        }

        return 
false;
    }

    
/**
     * {@inheritDoc}
     */
    
public function cleanup()
    {
        
$this->perforce->cleanupClientSpec();
        
$this->perforce null;
    }

    public function 
getDepot()
    {
        return 
$this->depot;
    }

    public function 
getBranch()
    {
        return 
$this->branch;
    }
}

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