PHP 클래스 Burgomaster, instantanalytics

파일 보기 프로젝트 열기: nystudio107/instantanalytics 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$projectRoot Root directory of the project
$stageDir Base staging directory of the project

공개 메소드들

메소드 설명
__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.

비공개 메소드들

메소드 설명
createDirIfNeeded ( $dir )
createStub ( $dest, string $autoloaderFilename = 'autoloader.php' ) : string Creates a default stub for the phar that includeds the generated autoloader.

메소드 상세

__construct() 공개 메소드

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.

__destruct() 공개 메소드

Cleanup if the last section was not already closed.
public __destruct ( )

createAutoloader() 공개 메소드

Creates a class-map autoloader to the staging directory in a file named autoloader.php
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.

createPhar() 공개 메소드

Call this only after your staging directory is built.
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.

createZip() 공개 메소드

Call this only after your staging directory is built.
public createZip ( string $dest )
$dest string Where to save the zip file

debug() 공개 메소드

Prints a debug message to STDERR bound to the current section.
public debug ( string $message )
$message string Message to echo to STDERR

deepCopy() 공개 메소드

Copies a file and creates the destination directory if needed.
public deepCopy ( string $from, string $to )
$from string File to copy
$to string Destination to copy the file to, relative to the base staging directory.

endSection() 공개 메소드

Call this method when leaving the last pushed section of the packager.
public endSection ( )

exec() 공개 메소드

Execute a command and throw an exception if the return code is not 0.
public exec ( string $command ) : string
$command string Command to execute
리턴 string Returns the output of the command as a string

recursiveCopy() 공개 메소드

Any LICENSE file is automatically copied.
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']).

startSection() 공개 메소드

This makes the debug messages used in your script more meaningful and adds context when things go wrong. Be sure to call endSection() when you have finished a section of your packaging script.
public startSection ( string $section )
$section string Part of the packager that is running

프로퍼티 상세

$projectRoot 공개적으로 프로퍼티

Root directory of the project
public $projectRoot

$stageDir 공개적으로 프로퍼티

Base staging directory of the project
public $stageDir