Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.119
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
php /
Composer /
Util /
Delete
Unzip
Name
Size
Permission
Date
Action
AuthHelper.php
1.66
KB
-rw-r--r--
2016-11-03 17:43
Bitbucket.php
6.69
KB
-rw-r--r--
2016-11-03 17:43
ComposerMirror.php
1.75
KB
-rw-r--r--
2016-11-03 17:43
ConfigValidator.php
6.42
KB
-rw-r--r--
2016-11-03 17:43
ErrorHandler.php
2.24
KB
-rw-r--r--
2016-11-03 17:43
Filesystem.php
20.89
KB
-rw-r--r--
2016-11-03 17:43
Git.php
13.66
KB
-rw-r--r--
2021-05-09 23:44
GitHub.php
4.48
KB
-rw-r--r--
2016-11-03 17:43
GitLab.php
5.1
KB
-rw-r--r--
2016-11-03 17:43
NoProxyPattern.php
4.07
KB
-rw-r--r--
2016-11-03 17:43
Perforce.php
17.17
KB
-rw-r--r--
2016-11-03 17:43
Platform.php
2.52
KB
-rw-r--r--
2016-11-03 17:43
ProcessExecutor.php
3.4
KB
-rw-r--r--
2016-11-03 17:43
RemoteFilesystem.php
39.12
KB
-rw-r--r--
2016-11-03 17:43
Silencer.php
2.12
KB
-rw-r--r--
2016-11-03 17:43
SpdxLicense.php
570
B
-rw-r--r--
2016-11-03 17:43
StreamContextFactory.php
6.93
KB
-rw-r--r--
2016-11-03 17:43
Svn.php
8.37
KB
-rw-r--r--
2021-05-09 23:44
TlsHelper.php
6.59
KB
-rw-r--r--
2016-11-03 17:43
Save
Rename
<?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\Util; use Composer\Factory; use Composer\IO\IOInterface; use Composer\Config; use Composer\Downloader\TransportException; /** * @author Jordi Boggiano <j.boggiano@seld.be> */ class GitHub { protected $io; protected $config; protected $process; protected $remoteFilesystem; /** * Constructor. * * @param IOInterface $io The IO instance * @param Config $config The composer configuration * @param ProcessExecutor $process Process instance, injectable for mocking * @param RemoteFilesystem $remoteFilesystem Remote Filesystem, injectable for mocking */ public function __construct(IOInterface $io, Config $config, ProcessExecutor $process = null, RemoteFilesystem $remoteFilesystem = null) { $this->io = $io; $this->config = $config; $this->process = $process ?: new ProcessExecutor; $this->remoteFilesystem = $remoteFilesystem ?: Factory::createRemoteFilesystem($this->io, $config); } /** * Attempts to authorize a GitHub domain via OAuth * * @param string $originUrl The host this GitHub instance is located at * @return bool true on success */ public function authorizeOAuth($originUrl) { if (!in_array($originUrl, $this->config->get('github-domains'))) { return false; } // if available use token from git config if (0 === $this->process->execute('git config github.accesstoken', $output)) { $this->io->setAuthentication($originUrl, trim($output), 'x-oauth-basic'); return true; } return false; } /** * Authorizes a GitHub domain interactively via OAuth * * @param string $originUrl The host this GitHub instance is located at * @param string $message The reason this authorization is required * @throws \RuntimeException * @throws TransportException|\Exception * @return bool true on success */ public function authorizeOAuthInteractively($originUrl, $message = null) { if ($message) { $this->io->writeError($message); } $note = 'Composer'; if ($this->config->get('github-expose-hostname') === true && 0 === $this->process->execute('hostname', $output)) { $note .= ' on ' . trim($output); } $note .= ' ' . date('Y-m-d Hi'); $url = 'https://'.$originUrl.'/settings/tokens/new?scopes=repo&description=' . str_replace('%20', '+', rawurlencode($note)); $this->io->writeError(sprintf('Head to %s', $url)); $this->io->writeError(sprintf('to retrieve a token. It will be stored in "%s" for future use by Composer.', $this->config->getAuthConfigSource()->getName())); $token = trim($this->io->askAndHideAnswer('Token (hidden): ')); if (!$token) { $this->io->writeError('<warning>No token given, aborting.</warning>'); $this->io->writeError('You can also add it manually later by using "composer config github-oauth.github.com <token>"'); return false; } $this->io->setAuthentication($originUrl, $token, 'x-oauth-basic'); try { $apiUrl = ('github.com' === $originUrl) ? 'api.github.com/' : $originUrl . '/api/v3/'; $this->remoteFilesystem->getContents($originUrl, 'https://'. $apiUrl, false, array( 'retry-auth-failure' => false, )); } catch (TransportException $e) { if (in_array($e->getCode(), array(403, 401))) { $this->io->writeError('<error>Invalid token provided.</error>'); $this->io->writeError('You can also add it manually later by using "composer config github-oauth.github.com <token>"'); return false; } throw $e; } // store value in user config $this->config->getConfigSource()->removeConfigSetting('github-oauth.'.$originUrl); $this->config->getAuthConfigSource()->addConfigSetting('github-oauth.'.$originUrl, $token); $this->io->writeError('<info>Token stored successfully.</info>'); return true; } }