PHP Класс SizeRestrictedPackageCache

Наследование: implements PackageCache
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$baseDir
$cacheSize

Открытые методы

Метод Описание
getPackageFilename ( PackageGenerator $generator, string $identifier, string $sha, string $repositoryDir, DeploynautLogFile $log ) : string Return the filename of the generated package, retrieving from cache or generating as necessary
setBaseDir ( string $baseDir ) The base directory to store cached packages in.
setCacheSize ( integer $cacheSize ) Set the maximum number of items that will be stored in the package cache.

Защищенные методы

Метод Описание
reduceDirSizeTo ( string $dir, integer $count, DeploynautLogFile $log ) Delete items in this directory until the number of items is <= $count.
sanitiseDirName ( string $identifier ) Take the identifier an make it safe to use as a directory name.

Описание методов

getPackageFilename() публичный Метод

Return the filename of the generated package, retrieving from cache or generating as necessary
public getPackageFilename ( PackageGenerator $generator, string $identifier, string $sha, string $repositoryDir, DeploynautLogFile $log ) : string
$generator PackageGenerator The generator to use to create cache entries.
$identifier string A unique identifier for the generator; used to partition the cache
$sha string The SHA of the commit to be deployed
$repositoryDir string The directory where the repository resides
$log DeploynautLogFile The log to write status output to, including package-generation commands
Результат string

reduceDirSizeTo() защищенный Метод

Delete the oldest files first.
protected reduceDirSizeTo ( string $dir, integer $count, DeploynautLogFile $log )
$dir string The directory to remove items from
$count integer The maximum number of .tar.gz files that can appear in that directory
$log DeploynautLogFile The log to send removal status messages to

sanitiseDirName() защищенный Метод

Take the identifier an make it safe to use as a directory name.
protected sanitiseDirName ( string $identifier )
$identifier string The unsanitised directory name.

setBaseDir() публичный Метод

The files will be stored in a subdirectory named after the identifier. If base directory isn't set, the getPackageFilename() won't run.
public setBaseDir ( string $baseDir )
$baseDir string The base directory

setCacheSize() публичный Метод

If null, items will never be deleted. If set, cache entries will be touched whenever they are accessed, and the least-recently-access items will be deleted.
public setCacheSize ( integer $cacheSize )
$cacheSize integer the number of package files to keep.

Описание свойств

$baseDir защищенное свойство

protected $baseDir

$cacheSize защищенное свойство

protected $cacheSize