Publish LaySite copyright notice and AGPL license

This commit is contained in:
2026-11-25 22:16:38 +08:00
parent acf59c9dfc
commit 080f146fef
10 changed files with 68 additions and 8 deletions
+13 -2
View File
@@ -8,7 +8,18 @@ use Composer\InstalledVersions;
final class Licenses
{
public const PROJECT = 'AGPL-3.0-only';
public const PROJECT = 'AGPL-3.0-or-later';
public const PROJECT_NAME = 'GNU Affero General Public License v3.0';
public const PROJECT_PATH = '/.laysite/license';
public static function projectText(): ?string
{
$root = dirname(__DIR__, 2);
$notice = @file_get_contents($root . '/NOTICE');
$license = @file_get_contents($root . '/LICENSE');
return $notice === false || $license === false ? null : rtrim($notice) . "\n\n" . $license;
}
public static function dependencies(): array
{
@@ -48,7 +59,7 @@ final class Licenses
public static function text(string $key): ?string
{
$path = $key === 'laysite' ? dirname(__DIR__, 2) . '/LICENSE' : (self::dependencies()[$key]['file'] ?? null);
$path = self::dependencies()[$key]['file'] ?? null;
$text = $path === null ? false : @file_get_contents($path);
return $text === false ? null : $text;