8000 Merge pull request #109 from thewilkybarkid/validate-composer-packages · jderusse/symfony@02524fc · GitHub
[go: up one dir, main page]

Skip to content

Commit 02524fc

Browse files
committed
Merge pull request symfony#109 from thewilkybarkid/validate-composer-packages
Validate Composer packages
2 parents 68a86fe + 15252b2 commit 02524fc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

framework/cms/SS-2015-008-1.yaml renamed to silverstripe/cms/SS-2015-008-1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ branches:
88
3.1.x:
99
time: 2015-03-19 16:54:00
1010
versions: [>=3.1.0,<3.1.11]
11-
reference: composer://framework/cms
11+
reference: composer://silverstripe/cms

validator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@
7272
if (str_replace(DIRECTORY_SEPARATOR, '/', dirname($path)) !== $composerPackage) {
7373
$messages[$path][] = 'Reference composer package must match the folder name';
7474
}
75+
76+
$packagistUrl = sprintf('https://packagist.org/packages/%s.json', $composerPackage);
77+
78+
if(404 == explode(' ', get_headers($packagistUrl)[0], 3)[1]) {
79+
$messages[$path][] = sprintf('Invalid composer package');
80+
}
7581
}
7682
}
7783

0 commit comments

Comments
 (0)
0