PHP Class Platformsh\Cli\Local\LocalBuild

Mostrar archivo Open project: commerceguys/platform-cli Class Usage Examples

Protected Properties

Property Type Description
$config Platformsh\Cli\CliConfig
$fsHelper Platformsh\Cli\Helper\FilesystemHelper
$gitHelper Platformsh\Cli\Helper\GitHelper
$output Symfony\Component\Console\Output\OutputInterface
$settings
$shellHelper Platformsh\Cli\Helper\ShellHelper

Public Methods

Method Description
__construct ( array $settings = [], CliConfig $config = null, Symfony\Component\Console\Output\OutputInterface $output = null ) LocalBuild constructor.
build ( string $sourceDir, string $destination = null, array $apps = [] ) : boolean Build a project from any source directory, targeting any destination.
cleanArchives ( string $projectRoot, integer $maxAge = null, integer $keepMax = 10, boolean $quiet = true ) : int[] Remove old build archives.
cleanBuilds ( string $projectRoot, integer $maxAge = null, integer $keepMax = 10, boolean $includeActive = false, boolean $quiet = true ) : int[] Remove old builds.
getTreeId ( string $appRoot ) : string | false Get a hash of the application files.

Protected Methods

Method Description
buildApp ( LocalApplication $app, string $sourceDir, string $destination = null ) : boolean
cleanDirectory ( string $directory, integer $maxAge = null, integer $keepMax = 5, array $blacklist = [], boolean $quiet = true ) : int[] Remove old files from a directory.
getActiveBuilds ( string $projectRoot ) : array
runHook ( string | array $hook, string $dir ) : boolean Run a user-defined hook.
runPostBuildHooks ( array $appConfig, string $buildDir ) : boolean | null Run post-build hooks.
runPostDeployHooks ( array $appConfig, string $appDir ) : boolean | null Run post-deploy hooks.

Method Details

__construct() public method

LocalBuild constructor.
public __construct ( array $settings = [], CliConfig $config = null, Symfony\Component\Console\Output\OutputInterface $output = null )
$settings array Possible settings: - clone (bool, default false) Clone the repository to the build directory before building, where possible. - copy (bool, default false) Copy files instead of symlinking them, where possible. - abslinks (bool, default false) Use absolute paths in symlinks. - no-archive (bool, default false) Do not archive or use an archive of the build. - no-cache (bool, default false) Disable the package cache (if relevant and if the package manager supports this). - no-clean (bool, default false) Disable cleaning up old builds or old build archives. - no-build-hooks (bool, default false) Disable running build hooks. - concurrency (int) Specify a concurrency for Drush Make, if applicable (when using the Drupal toolstack). - working-copy (bool, default false) Specify the --working-copy option to Drush Make, if applicable. - lock (bool, default false) Create or update a lock file via Drush Make, if applicable. - run-deploy-hooks (bool, default false) Run deploy hooks.
$config Platformsh\Cli\CliConfig Optionally, inject a specific CLI configuration object.
$output Symfony\Component\Console\Output\OutputInterface Optionally, inject a specific Symfony Console output object.

build() public method

Build a project from any source directory, targeting any destination.
public build ( string $sourceDir, string $destination = null, array $apps = [] ) : boolean
$sourceDir string The absolute path to the source directory.
$destination string Where the web root(s) will be linked (absolute path).
$apps array An array of application names to build.
return boolean

buildApp() protected method

protected buildApp ( LocalApplication $app, string $sourceDir, string $destination = null ) : boolean
$app LocalApplication
$sourceDir string
$destination string
return boolean

cleanArchives() public method

Remove old build archives.
public cleanArchives ( string $projectRoot, integer $maxAge = null, integer $keepMax = 10, boolean $quiet = true ) : int[]
$projectRoot string
$maxAge integer
$keepMax integer
$quiet boolean
return int[] The numbers of deleted and kept builds.

cleanBuilds() public method

This preserves the currently active build.
Deprecation: No longer needed from 3.0.0.
public cleanBuilds ( string $projectRoot, integer $maxAge = null, integer $keepMax = 10, boolean $includeActive = false, boolean $quiet = true ) : int[]
$projectRoot string
$maxAge integer
$keepMax integer
$includeActive boolean
$quiet boolean
return int[] The numbers of deleted and kept builds.

cleanDirectory() protected method

Remove old files from a directory.
protected cleanDirectory ( string $directory, integer $maxAge = null, integer $keepMax = 5, array $blacklist = [], boolean $quiet = true ) : int[]
$directory string
$maxAge integer
$keepMax integer
$blacklist array
$quiet boolean
return int[]

getActiveBuilds() protected method

protected getActiveBuilds ( string $projectRoot ) : array
$projectRoot string
return array The absolute paths to any active builds in the project.

getTreeId() public method

This should change if any of the application files or build settings change.
public getTreeId ( string $appRoot ) : string | false
$appRoot string
return string | false

runHook() protected method

Run a user-defined hook.
protected runHook ( string | array $hook, string $dir ) : boolean
$hook string | array
$dir string
return boolean

runPostBuildHooks() protected method

Run post-build hooks.
protected runPostBuildHooks ( array $appConfig, string $buildDir ) : boolean | null
$appConfig array
$buildDir string
return boolean | null False if the build hooks fail, true if they succeed, null if not applicable.

runPostDeployHooks() protected method

Run post-deploy hooks.
protected runPostDeployHooks ( array $appConfig, string $appDir ) : boolean | null
$appConfig array
$appDir string
return boolean | null False if the deploy hooks fail, true if they succeed, null if not applicable.

Property Details

$config protected_oe property

protected CliConfig,Platformsh\Cli $config
return Platformsh\Cli\CliConfig

$fsHelper protected_oe property

protected FilesystemHelper,Platformsh\Cli\Helper $fsHelper
return Platformsh\Cli\Helper\FilesystemHelper

$gitHelper protected_oe property

protected GitHelper,Platformsh\Cli\Helper $gitHelper
return Platformsh\Cli\Helper\GitHelper

$output protected_oe property

protected OutputInterface,Symfony\Component\Console\Output $output
return Symfony\Component\Console\Output\OutputInterface

$settings protected_oe property

protected $settings

$shellHelper protected_oe property

protected ShellHelper,Platformsh\Cli\Helper $shellHelper
return Platformsh\Cli\Helper\ShellHelper