PHP Class PackageGenerator

A package file is a .tar.gz file of the project, ready to be uploaded to the server These package generators can be used by applicable deployment backends.
显示文件 Open project: silverstripe/deploynaut Class Usage Examples

Protected Properties

Property Type Description
$cache

Public Methods

Method Description
generatePackage ( string $sha, string $baseDir, $outputFilename, DeploynautLogFile $log ) : boolean Generate the package file, saving to the given location
getCache ( )
getIdentifier ( ) Return a string that uniquely identifies this package generator.
getPackageFilename ( string $identifier, string $sha, string $repositoryDir, DeploynautLogFile $log ) : string Generate or retrieve a package from the cache
setCache ( PackageCache $cache )

Method Details

generatePackage() abstract public method

Generate the package file, saving to the given location
abstract public generatePackage ( string $sha, string $baseDir, $outputFilename, DeploynautLogFile $log ) : boolean
$sha string
$baseDir string string The base directory of the project, checked out from git.
$outputFilename string The filename to write to.
$log DeploynautLogFile
return boolean True on success

getCache() public method

public getCache ( )

getIdentifier() abstract public method

This will be used as part of cache keys; if meaningful changes to the operation of the generator are made, then the identifier should change. Note there is no need to include the classname in the identifier; callers to getIdentifier() should be responsible for disambiguating based on class.
abstract public getIdentifier ( )

getPackageFilename() public method

Generate or retrieve a package from the cache
public getPackageFilename ( string $identifier, string $sha, string $repositoryDir, DeploynautLogFile $log ) : string
$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
return string

setCache() public method

public setCache ( PackageCache $cache )
$cache PackageCache

Property Details

$cache protected_oe property

protected $cache