/var/www/vhosts/ihelp.ro/httpdocs/vendor/composer/composer/src/Composer/Util
NameSizeModeActions
Http/-0755rm
AuthHelper.php146420644editdlrm
Bitbucket.php99370644editdlrm
ComposerMirror.php24000644editdlrm
ConfigValidator.php92640644editdlrm
ErrorHandler.php24940644editdlrm
Filesystem.php287120644editdlrm
Git.php227350644editdlrm
GitHub.php85520644editdlrm
GitLab.php122860644editdlrm
Hg.php32630644editdlrm
HttpDownloader.php183980644editdlrm
IniHelper.php16460644editdlrm
Loop.php36110644editdlrm
MetadataMinifier.php6500644editdlrm
NoProxyPattern.php108710644editdlrm
PackageInfo.php10920644editdlrm
PackageSorter.php41830644editdlrm
Perforce.php188160644editdlrm
Platform.php87840644editdlrm
ProcessExecutor.php142000644editdlrm
RemoteFilesystem.php274710644editdlrm
Silencer.php20990644editdlrm
StreamContextFactory.php95460644editdlrm
Svn.php98900644editdlrm
SyncHelper.php27760644editdlrm
Tar.php17720644editdlrm
TlsHelper.php70470644editdlrm
Url.php53790644editdlrm
Zip.php33930644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/composer/composer/src/Composer/Util/ComposerMirror.php (2400B)
* Jordi Boggiano * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Util; use Composer\Pcre\Preg; /** * Composer mirror utilities * * @author Jordi Boggiano */ class ComposerMirror { /** * @param non-empty-string $mirrorUrl * @return non-empty-string */ public static function processUrl(string $mirrorUrl, string $packageName, string $version, ?string $reference, ?string $type, ?string $prettyVersion = null): string { if ($reference) { $reference = Preg::isMatch('{^([a-f0-9]*|%reference%)$}', $reference) ? $reference : md5($reference); } $version = strpos($version, '/') === false ? $version : md5($version); $from = ['%package%', '%version%', '%reference%', '%type%']; $to = [$packageName, $version, $reference, $type]; if (null !== $prettyVersion) { $from[] = '%prettyVersion%'; $to[] = $prettyVersion; } $url = str_replace($from, $to, $mirrorUrl); assert($url !== ''); return $url; } /** * @param non-empty-string $mirrorUrl * @return string */ public static function processGitUrl(string $mirrorUrl, string $packageName, string $url, ?string $type): string { if (Preg::isMatch('#^(?:(?:https?|git)://github\.com/|git@github\.com:)([^/]+)/(.+?)(?:\.git)?$#', $url, $match)) { $url = 'gh-'.$match[1].'/'.$match[2]; } elseif (Preg::isMatch('#^https://bitbucket\.org/([^/]+)/(.+?)(?:\.git)?/?$#', $url, $match)) { $url = 'bb-'.$match[1].'/'.$match[2]; } else { $url = Preg::replace('{[^a-z0-9_.-]}i', '-', trim($url, '/')); } return str_replace( ['%package%', '%normalizedUrl%', '%type%'], [$packageName, $url, $type], $mirrorUrl ); } /** * @param non-empty-string $mirrorUrl * @return string */ public static function processHgUrl(string $mirrorUrl, string $packageName, string $url, string $type): string { return self::processGitUrl($mirrorUrl, $packageName, $url, $type); } }