v7.0.0-beta.2 release
This commit is contained in:
1 parent
6595fd0eb5
commit
fa8eba7a0d
1165 files changed
+107118
-762127
No files matched your search
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Extension\Vendor;
|
||||
|
||||
/**
|
||||
* Vendor 번들 빌드 결과 DTO.
|
||||
*/
|
||||
class VendorBundleResult
|
||||
{
|
||||
/**
|
||||
* @param string $target 'core' | 'module:identifier' | 'plugin:identifier'
|
||||
* @param string $zipPath 생성된 zip 파일 절대 경로
|
||||
* @param string $manifestPath 생성된 vendor-bundle.json 절대 경로
|
||||
* @param int $zipSize zip 파일 크기 (bytes)
|
||||
* @param int $packageCount 번들에 포함된 composer 패키지 수
|
||||
* @param bool $skipped 이미 최신 상태여서 빌드 스킵 여부
|
||||
* @param string $reason 스킵 사유 또는 빌드 메시지
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $target,
|
||||
public readonly string $zipPath,
|
||||
public readonly string $manifestPath,
|
||||
public readonly int $zipSize,
|
||||
public readonly int $packageCount,
|
||||
public readonly bool $skipped = false,
|
||||
public readonly string $reason = '',
|
||||
) {}
|
||||
|
||||
public function zipSizeHuman(): string
|
||||
{
|
||||
$units = ['B', 'KB', 'MB', 'GB'];
|
||||
$size = $this->zipSize;
|
||||
$unit = 0;
|
||||
while ($size >= 1024 && $unit < count($units) - 1) {
|
||||
$size /= 1024;
|
||||
$unit++;
|
||||
}
|
||||
|
||||
return sprintf('%.1f %s', $size, $units[$unit]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user