mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Use pathinfo instead of substr
This commit is contained in:
parent
f93ec9daa4
commit
48ae8bf3ec
2 changed files with 4 additions and 2 deletions
|
@ -84,7 +84,7 @@ EOT
|
|||
|
||||
if (null === $repositoryUrl) {
|
||||
$sourceRepo = new ComposerRepository(array('url' => 'http://packagist.org'), $io);
|
||||
} elseif (".json" === substr($repositoryUrl, -5)) {
|
||||
} elseif ("json" === pathinfo($repositoryUrl, PATHINFO_EXTENSION)) {
|
||||
$sourceRepo = new FilesystemRepository(new JsonFile($repositoryUrl, new RemoteFilesystem($io)));
|
||||
} elseif (0 === strpos($repositoryUrl, 'http')) {
|
||||
$sourceRepo = new ComposerRepository(array('url' => $repositoryUrl), $io);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue