PHP Class Cake\Upgrade\Shell\Task\StageTask

Handles staging changes for the upgrade process
Inheritance: extends Cake\Console\Shell
Afficher le fichier Open project: cakephp/upgrade

Protected Properties

Свойство Type Description
$_files array Files
$_mkdirCommand string mkdir command to use for creating folders/paths.
$_paths array Paths
$_staged array Staged changes for processing at the end

Méthodes publiques

Méthode Description
__construct ( ConsoleIo $io = null ) {@inheritDoc}
change ( string $filePath, string $original, string $updated ) : boolean Store a change for a file
clear ( ) : void Clears the change log.
commit ( string $path = null ) : void Write staged changes
delete ( string $path ) : boolean delete
files ( array $excludes = [], boolean $reset = false ) : array Searches the paths and finds files based on extension.
move ( string $from, string $to ) : boolean move
source ( string $path ) : string Get the source of a file, taking into account that there may be incremental diffs

Méthodes protégées

Méthode Description
_getPath ( ) : string Get the path to operate on. Uses either the first argument, or the plugin parameter if its set.
_gitMove ( string $gitCd, string $from, string $to ) : void Moves files or folders using GIT.
_makeDir ( string $path ) : void Creates a directory/path.

Method Details

__construct() public méthode

{@inheritDoc}
public __construct ( ConsoleIo $io = null )
$io Cake\Console\ConsoleIo

_getPath() protected méthode

Get the path to operate on. Uses either the first argument, or the plugin parameter if its set.
protected _getPath ( ) : string
Résultat string

_gitMove() protected méthode

Moves files or folders using GIT.
protected _gitMove ( string $gitCd, string $from, string $to ) : void
$gitCd string The `cd` command that changes into the files/folder parent directory
$from string The source path
$to string The target path
Résultat void

_makeDir() protected méthode

Creates a directory/path.
protected _makeDir ( string $path ) : void
$path string The directory/path to create.
Résultat void

change() public méthode

Store a change for a file
public change ( string $filePath, string $original, string $updated ) : boolean
$filePath string (unused, for future reference)
$original string
$updated string
Résultat boolean

clear() public méthode

Clears the change log.
public clear ( ) : void
Résultat void

commit() public méthode

If it's a dry run though - only show what will be done, don't do anything
public commit ( string $path = null ) : void
$path string file path
Résultat void

delete() public méthode

delete
public delete ( string $path ) : boolean
$path string
Résultat boolean

files() public méthode

Searches the paths and finds files based on extension.
public files ( array $excludes = [], boolean $reset = false ) : array
$excludes array
$reset boolean
Résultat array

move() public méthode

move
public move ( string $from, string $to ) : boolean
$from string
$to string
Résultat boolean

source() public méthode

Get the source of a file, taking into account that there may be incremental diffs
public source ( string $path ) : string
$path string
Résultat string

Property Details

$_files protected_oe property

Files
protected array $_files
Résultat array

$_mkdirCommand protected_oe property

mkdir command to use for creating folders/paths.
protected string $_mkdirCommand
Résultat string

$_paths protected_oe property

Paths
protected array $_paths
Résultat array

$_staged protected_oe property

Staged changes for processing at the end
protected array $_staged
Résultat array