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 authored and nickvergessen committed Jul 21, 2016
1 parent c98de82 commit b64c6d6
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, $licenseHeaderEndsAtLine);
foreach ($licensePart as $line) {
if (strpos($line, '@copyright') !== false) {
$copyrightNotice[] = $line;
}
Expand Down

0 comments on commit b64c6d6

Please sign in to comment.