1
0
Fork 0
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:
Jordi Boggiano 2012-04-09 16:46:25 +02:00
parent f93ec9daa4
commit 48ae8bf3ec
2 changed files with 4 additions and 2 deletions

View file

@ -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);