PHP Class Platformsh\Cli\Local\LocalBuild

Afficher le fichier Open project: commerceguys/platform-cli Class Usage Examples

Protected Properties

Свойство 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

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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 méthode

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 méthode

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.
Résultat boolean

buildApp() protected méthode

protected buildApp ( LocalApplication $app, string $sourceDir, string $destination = null ) : boolean
$app LocalApplication
$sourceDir string
$destination string
Résultat boolean

cleanArchives() public méthode

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
Résultat int[] The numbers of deleted and kept builds.

cleanBuilds() public méthode

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
Résultat int[] The numbers of deleted and kept builds.

cleanDirectory() protected méthode

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
Résultat int[]

getActiveBuilds() protected méthode

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

getTreeId() public méthode

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

runHook() protected méthode

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

runPostBuildHooks() protected méthode

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

runPostDeployHooks() protected méthode

Run post-deploy hooks.
protected runPostDeployHooks ( array $appConfig, string $appDir ) : boolean | null
$appConfig array
$appDir string
Résultat 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
Résultat Platformsh\Cli\CliConfig

$fsHelper protected_oe property

protected FilesystemHelper,Platformsh\Cli\Helper $fsHelper
Résultat Platformsh\Cli\Helper\FilesystemHelper

$gitHelper protected_oe property

protected GitHelper,Platformsh\Cli\Helper $gitHelper
Résultat Platformsh\Cli\Helper\GitHelper

$output protected_oe property

protected OutputInterface,Symfony\Component\Console\Output $output
Résultat Symfony\Component\Console\Output\OutputInterface

$settings protected_oe property

protected $settings

$shellHelper protected_oe property

protected ShellHelper,Platformsh\Cli\Helper $shellHelper
Résultat Platformsh\Cli\Helper\ShellHelper