diff --git a/build/license.php b/build/license.php
index 493c7dafd9858..bed3854925ff2 100644
--- a/build/license.php
+++ b/build/license.php
@@ -27,6 +27,27 @@ class Licenses
public function __construct() {
$this->licenseText = <<.
+ *
+ */
+EOD;
+ $this->licenseTextLegacy = <<licenseText = str_replace('@YEAR@', date("Y"), $this->licenseText);
+ $this->licenseTextLegacy = str_replace('@YEAR@', date("Y"), $this->licenseTextLegacy);
}
/**
@@ -118,10 +139,15 @@ function handleFile($path, $gitRoot) {
echo "MIT licensed file: $path" . PHP_EOL;
return;
}
- $source = $this->eatOldLicense($source);
- $authors = $this->getAuthors($path, $gitRoot);
- $license = str_replace('@AUTHORS@', $authors, $this->licenseText);
+ if ($this->isOwnCloudLicensed($source)) {
+ $authors = $this->getAuthors($path, $gitRoot, true);
+ $license = str_replace('@AUTHORS@', $authors, $this->licenseTextLegacy);
+ } else {
+ $authors = $this->getAuthors($path, $gitRoot);
+ $license = str_replace('@AUTHORS@', $authors, $this->licenseText);
+ }
+ $source = $this->eatOldLicense($source);
$source = "authors[$author] = $author;
- return " * @author $author";
- }, $authors);
+ if ($legacyFiles) {
+ $authors = array_map(function($author){
+ $this->authors[$author] = $author;
+ return " * @author $author";
+ }, $authors);
+ } else {
+ $authors = array_map(function($author){
+ $this->authors[$author] = $author;
+ return " * @copyright Copyright (c) " . date("Y") . ", $author";
+ }, $authors);
+ }
+
+
return implode(PHP_EOL, $authors);
}