PHP Класс Platformsh\Cli\Local\LocalBuild

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$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

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

Метод Описание
__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.

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

Метод Описание
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.

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

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

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() публичный Метод

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.
Результат boolean

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

protected buildApp ( LocalApplication $app, string $sourceDir, string $destination = null ) : boolean
$app LocalApplication
$sourceDir string
$destination string
Результат boolean

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

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
Результат int[] The numbers of deleted and kept builds.

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

This preserves the currently active build.
Устаревший: 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
Результат int[] The numbers of deleted and kept builds.

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

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
Результат int[]

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

protected getActiveBuilds ( string $projectRoot ) : array
$projectRoot string
Результат array The absolute paths to any active builds in the project.

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

This should change if any of the application files or build settings change.
public getTreeId ( string $appRoot ) : string | false
$appRoot string
Результат string | false

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

Run a user-defined hook.
protected runHook ( string | array $hook, string $dir ) : boolean
$hook string | array
$dir string
Результат boolean

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

Run post-build hooks.
protected runPostBuildHooks ( array $appConfig, string $buildDir ) : boolean | null
$appConfig array
$buildDir string
Результат boolean | null False if the build hooks fail, true if they succeed, null if not applicable.

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

Run post-deploy hooks.
protected runPostDeployHooks ( array $appConfig, string $appDir ) : boolean | null
$appConfig array
$appDir string
Результат boolean | null False if the deploy hooks fail, true if they succeed, null if not applicable.

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

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

protected CliConfig,Platformsh\Cli $config
Результат Platformsh\Cli\CliConfig

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

protected FilesystemHelper,Platformsh\Cli\Helper $fsHelper
Результат Platformsh\Cli\Helper\FilesystemHelper

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

protected GitHelper,Platformsh\Cli\Helper $gitHelper
Результат Platformsh\Cli\Helper\GitHelper

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

protected OutputInterface,Symfony\Component\Console\Output $output
Результат Symfony\Component\Console\Output\OutputInterface

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

protected $settings

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

protected ShellHelper,Platformsh\Cli\Helper $shellHelper
Результат Platformsh\Cli\Helper\ShellHelper