Свойство | Type | Description | |
---|---|---|---|
$projectRoot | Root directory of the project | ||
$stageDir | Base staging directory of the project |
Méthode | Description | |
---|---|---|
__construct ( string $stageDir, string $projectRoot = null ) | ||
__destruct ( ) | Cleanup if the last section was not already closed. | |
createAutoloader ( array $files = [], string $filename = 'autoloader.php' ) | Creates a class-map autoloader to the staging directory in a file named autoloader.php | |
createPhar ( string $dest, string | boolean | null $stub = null, string $autoloaderFilename = 'autoloader.php' ) | Creates a phar that automatically registers an autoloader. | |
createZip ( string $dest ) | Creates a zip file containing the staged files of your project. | |
debug ( string $message ) | Prints a debug message to STDERR bound to the current section. | |
deepCopy ( string $from, string $to ) | Copies a file and creates the destination directory if needed. | |
endSection ( ) | Call this method when leaving the last pushed section of the packager. | |
exec ( string $command ) : string | Execute a command and throw an exception if the return code is not 0. | |
recursiveCopy ( string $sourceDir, string $destDir, array $extensions = ['php'] ) | Recursively copy one folder to another. | |
startSection ( string $section ) | Call this method when starting a specific section of the packager. |
Méthode | Description | |
---|---|---|
createDirIfNeeded ( $dir ) | ||
createStub ( $dest, string $autoloaderFilename = 'autoloader.php' ) : string | Creates a default stub for the phar that includeds the generated autoloader. |
public __construct ( string $stageDir, string $projectRoot = null ) | ||
$stageDir | string | Staging base directory where your packaging takes place. This folder will be created for you if it does not exist. If it exists, it will be deleted and recreated to start fresh. |
$projectRoot | string | Root directory of the project. |
public __destruct ( ) |
public createAutoloader ( array $files = [], string $filename = 'autoloader.php' ) | ||
$files | array | Files to explicitly require in the autoloader. This is similar to Composer's "files" "autoload" section. |
$filename | string | Name of the autoloader file. |
public createPhar ( string $dest, string | boolean | null $stub = null, string $autoloaderFilename = 'autoloader.php' ) | ||
$dest | string | Where to save the file. The basename of the file is also used as the alias name in the phar (e.g., /path/to/guzzle.phar => guzzle.phar). |
$stub | string | boolean | null | The path to the phar stub file. Pass or leave null to automatically have one created for you. Pass false to no use a stub in the generated phar. |
$autoloaderFilename | string | Name of the autolaoder filename. |
public endSection ( ) |
public recursiveCopy ( string $sourceDir, string $destDir, array $extensions = ['php'] ) | ||
$sourceDir | string | Source directory to copy from |
$destDir | string | Directory to copy the files to that is relative to the the stage base directory. |
$extensions | array | File extensions to copy from the $sourceDir. Defaults to "php" files only (e.g., ['php']). |
public startSection ( string $section ) | ||
$section | string | Part of the packager that is running |