Skip to content

Commit

Permalink
only search the license header for @copyright statements
Browse files Browse the repository at this point in the history
  • Loading branch information
schiessle committed Jul 21, 2016
1 parent 78a8023 commit e730b0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build/license.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,10 @@ private function eatOldLicense($source) {

private function getCopyrightNotices($path, $file) {
$licenseHeaderEndsAtLine = (int)trim(shell_exec("grep -n '*/' $path | head -n 1 | cut -d ':' -f 1"));
$lineByLine = explode(PHP_EOL, $file, $licenseHeaderEndsAtLine);
$lineByLine = explode(PHP_EOL, $file, $licenseHeaderEndsAtLine + 1);
$copyrightNotice = [];
foreach ($lineByLine as $line) {
$licensePart = array_slice($lineByLine, 0, 20);
foreach ($licensePart as $line) {
if (strpos($line, '@copyright') !== false) {
$copyrightNotice[] = $line;
}
Expand Down

0 comments on commit e730b0c

Please sign in to comment.